Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5208)

Unified Diff: chrome/browser/ui/ash/launcher/chrome_launcher_controller.cc

Issue 320223002: Add device policy: Kiosk Virtual Keyboard Layout. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix typo. Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/ash/launcher/chrome_launcher_controller.cc
diff --git a/chrome/browser/ui/ash/launcher/chrome_launcher_controller.cc b/chrome/browser/ui/ash/launcher/chrome_launcher_controller.cc
index 63b51ad5ddce1b4b98d54c13665faefd29b63a66..225ac6beb85c4f73b9b3edfd928be4f2bb64bb65 100644
--- a/chrome/browser/ui/ash/launcher/chrome_launcher_controller.cc
+++ b/chrome/browser/ui/ash/launcher/chrome_launcher_controller.cc
@@ -446,6 +446,9 @@ void ChromeLauncherController::Init() {
if (ash::Shell::HasInstance()) {
SetShelfAutoHideBehaviorFromPrefs();
SetShelfAlignmentFromPrefs();
+#if defined(OS_CHROMEOS)
+ SetVirtualKeyboardBehaviorFromPrefs();
+#endif // defined(OS_CHROMEOS)
PrefServiceSyncable* prefs = PrefServiceSyncable::FromProfile(profile_);
if (!prefs->FindPreference(prefs::kShelfAlignmentLocal)->HasUserSetting() ||
!prefs->FindPreference(prefs::kShelfAutoHideBehaviorLocal)->
@@ -1128,6 +1131,9 @@ void ChromeLauncherController::ActiveUserChanged(
SetShelfAlignmentFromPrefs();
SetShelfAutoHideBehaviorFromPrefs();
SetShelfBehaviorsFromPrefs();
+#if defined(OS_CHROMEOS)
+ SetVirtualKeyboardBehaviorFromPrefs();
+#endif // defined(OS_CHROMEOS)
// Restore the order of running, but unpinned applications for the activated
// user.
RestoreUnpinnedRunningApplicationOrder(user_email);
@@ -1710,6 +1716,21 @@ void ChromeLauncherController::SetShelfBehaviorsFromPrefs() {
SetShelfAlignmentFromPrefs();
}
+#if defined(OS_CHROMEOS)
+void ChromeLauncherController::SetVirtualKeyboardBehaviorFromPrefs() {
+ const PrefService* service = profile_->GetPrefs();
+ if (!service->HasPrefPath(prefs::kTouchVirtualKeyboardEnabled)) {
+ keyboard::SetKeyboardShowOverride(keyboard::KEYBOARD_SHOW_OVERRIDE_NONE);
+ } else {
+ const bool enabled = service->GetBoolean(
+ prefs::kTouchVirtualKeyboardEnabled);
+ keyboard::SetKeyboardShowOverride(
+ enabled ? keyboard::KEYBOARD_SHOW_OVERRIDE_ENABLED
+ : keyboard::KEYBOARD_SHOW_OVERRIDE_DISABLED);
+ }
+}
+#endif // defined(OS_CHROMEOS)
+
ash::ShelfItemStatus ChromeLauncherController::GetAppState(
const::std::string& app_id) {
ash::ShelfItemStatus status = ash::STATUS_CLOSED;
@@ -2030,6 +2051,10 @@ void ChromeLauncherController::AttachProfile(Profile* profile) {
prefs::kShelfPreferences,
base::Bind(&ChromeLauncherController::SetShelfBehaviorsFromPrefs,
base::Unretained(this)));
+ pref_change_registrar_.Add(
bartfab (slow) 2014/06/16 14:14:02 This will need to be #ifdef'd as well.
rsadam 2014/06/16 14:35:39 Done.
+ prefs::kTouchVirtualKeyboardEnabled,
+ base::Bind(&ChromeLauncherController::SetVirtualKeyboardBehaviorFromPrefs,
+ base::Unretained(this)));
}
void ChromeLauncherController::ReleaseProfile() {

Powered by Google App Engine
This is Rietveld 408576698