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..0ad44ab0b4955a32e7fd59cf6ad3b831c8fbdae5 100644 |
--- a/chrome/browser/ui/ash/launcher/chrome_launcher_controller.cc |
+++ b/chrome/browser/ui/ash/launcher/chrome_launcher_controller.cc |
@@ -446,6 +446,7 @@ void ChromeLauncherController::Init() { |
if (ash::Shell::HasInstance()) { |
SetShelfAutoHideBehaviorFromPrefs(); |
SetShelfAlignmentFromPrefs(); |
+ SetVirtualKeyboardBehaviorFromPrefs(); |
PrefServiceSyncable* prefs = PrefServiceSyncable::FromProfile(profile_); |
if (!prefs->FindPreference(prefs::kShelfAlignmentLocal)->HasUserSetting() || |
!prefs->FindPreference(prefs::kShelfAutoHideBehaviorLocal)-> |
@@ -1128,6 +1129,7 @@ void ChromeLauncherController::ActiveUserChanged( |
SetShelfAlignmentFromPrefs(); |
SetShelfAutoHideBehaviorFromPrefs(); |
SetShelfBehaviorsFromPrefs(); |
+ SetVirtualKeyboardBehaviorFromPrefs(); |
// Restore the order of running, but unpinned applications for the activated |
// user. |
RestoreUnpinnedRunningApplicationOrder(user_email); |
@@ -1710,6 +1712,18 @@ void ChromeLauncherController::SetShelfBehaviorsFromPrefs() { |
SetShelfAlignmentFromPrefs(); |
} |
+void ChromeLauncherController::SetVirtualKeyboardBehaviorFromPrefs() { |
+ PrefService* service = profile_->GetPrefs(); |
+ if (!service->HasPrefPath(prefs::kVirtualKeyboardEnabled)) { |
bartfab (slow)
2014/06/13 12:15:53
Rather than checking whether the pref exists, just
rsadam
2014/06/13 15:28:46
Won't we need this check even if we ifdef? For exa
|
+ keyboard::SetKeyboardShowOverride(keyboard::KEYBOARD_SHOW_OVERRIDE_NONE); |
bartfab (slow)
2014/06/13 12:15:53
This does not look right to me: You take a per-pro
rsadam
2014/06/13 15:28:46
I believe that this would follow the profile setti
|
+ } else { |
+ bool enabled = service->GetBoolean(prefs::kVirtualKeyboardEnabled); |
+ keyboard::SetKeyboardShowOverride( |
+ enabled ? keyboard::KEYBOARD_SHOW_OVERRIDE_ENABLED |
+ : keyboard::KEYBOARD_SHOW_OVERRIDE_DISABLED); |
+ } |
+} |
+ |
ash::ShelfItemStatus ChromeLauncherController::GetAppState( |
const::std::string& app_id) { |
ash::ShelfItemStatus status = ash::STATUS_CLOSED; |
@@ -2030,6 +2044,10 @@ void ChromeLauncherController::AttachProfile(Profile* profile) { |
prefs::kShelfPreferences, |
base::Bind(&ChromeLauncherController::SetShelfBehaviorsFromPrefs, |
base::Unretained(this))); |
+ pref_change_registrar_.Add( |
+ prefs::kVirtualKeyboardEnabled, |
+ base::Bind(&ChromeLauncherController::SetVirtualKeyboardBehaviorFromPrefs, |
+ base::Unretained(this))); |
} |
void ChromeLauncherController::ReleaseProfile() { |