forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Renaming the Contained Shell to Kiosk Next Shell.
This is only the first step of renaming this feature, the next steps are: - Rename the Contained Shell references in chrome://settings and the rest of the browser. - Rename all occurrences of Contained Home to KioskNextHome. For this change, I'm mostly focusing on code living in ash. We are changing the name of this feature to reflect the refactoring work and ultimate goal. Also considered calling it MojoKiosk, but Mojo team prefers to keep the Mojo name referring specifically to the Mojo library, not uses of the library. Bug: 933530 Change-Id: I717cee439da14d6bbd575c26b9f55805ad4d5cd8 Reviewed-on: https://chromium-review.googlesource.com/c/1489272 Reviewed-by: Dominick Ng <dominickn@chromium.org> Reviewed-by: Istiaque Ahmed <lazyboy@chromium.org> Reviewed-by: Mitsuru Oshima (OOO til 3/4) <oshima@chromium.org> Reviewed-by: Michael Giuffrida <michaelpg@chromium.org> Commit-Queue: Lucas Tenório <ltenorio@chromium.org> Cr-Commit-Position: refs/heads/master@{#636800}
- Loading branch information
Lucas Tenório
authored and
Commit Bot
committed
Mar 1, 2019
1 parent
a04cee5
commit 6ca0ed7
Showing
37 changed files
with
307 additions
and
309 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
// Copyright 2018 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#include "ash/kiosk_next/kiosk_next_shell_controller.h" | ||
|
||
#include <utility> | ||
|
||
#include "ash/public/cpp/ash_features.h" | ||
#include "ash/public/cpp/ash_pref_names.h" | ||
#include "ash/session/session_controller.h" | ||
#include "ash/shell.h" | ||
#include "components/account_id/account_id.h" | ||
#include "components/prefs/pref_registry_simple.h" | ||
#include "components/prefs/pref_service.h" | ||
|
||
namespace ash { | ||
|
||
KioskNextShellController::KioskNextShellController() = default; | ||
|
||
KioskNextShellController::~KioskNextShellController() = default; | ||
|
||
// static | ||
void KioskNextShellController::RegisterProfilePrefs( | ||
PrefRegistrySimple* registry) { | ||
registry->RegisterBooleanPref(prefs::kKioskNextShellEnabled, false, | ||
PrefRegistry::PUBLIC); | ||
} | ||
|
||
void KioskNextShellController::BindRequest( | ||
mojom::KioskNextShellControllerRequest request) { | ||
bindings_.AddBinding(this, std::move(request)); | ||
} | ||
|
||
bool KioskNextShellController::IsEnabled() { | ||
if (!base::FeatureList::IsEnabled(features::kKioskNextShell)) | ||
return false; | ||
|
||
PrefService* prefs = | ||
Shell::Get()->session_controller()->GetPrimaryUserPrefService(); | ||
|
||
DCHECK(prefs) << "PrefService should not be null when reading Kiosk Next " | ||
"Shell pref. This usually happens when calling " | ||
"KioskNextShellController::IsEnabled() before sign in."; | ||
return prefs->GetBoolean(prefs::kKioskNextShellEnabled); | ||
} | ||
|
||
void KioskNextShellController::LaunchKioskNextShellIfEnabled() { | ||
if (!IsEnabled()) | ||
return; | ||
kiosk_next_shell_client_->LaunchKioskNextShell(Shell::Get() | ||
->session_controller() | ||
->GetPrimaryUserSession() | ||
->user_info->account_id); | ||
} | ||
|
||
void KioskNextShellController::SetClient( | ||
mojom::KioskNextShellClientPtr client) { | ||
kiosk_next_shell_client_ = std::move(client); | ||
} | ||
|
||
} // namespace ash |
Oops, something went wrong.