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

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: 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..2816946028207f6dc6b0f9f9f10478e83e33e55f 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,20 @@ void ChromeLauncherController::SetShelfBehaviorsFromPrefs() {
SetShelfAlignmentFromPrefs();
}
+void ChromeLauncherController::SetVirtualKeyboardBehaviorFromPrefs() {
+ #if defined(OS_CHROMEOS)
bartfab (slow) 2014/06/16 10:20:13 Nit: Since this method does nothing on other platf
rsadam 2014/06/16 13:45:34 Done.
+ PrefService* service = profile_->GetPrefs();
bartfab (slow) 2014/06/16 10:20:13 Nit: const.
rsadam 2014/06/16 13:45:34 Done.
+ if (!service->HasPrefPath(prefs::kTouchVirtualKeyboardEnabled)) {
+ keyboard::SetKeyboardShowOverride(keyboard::KEYBOARD_SHOW_OVERRIDE_NONE);
+ } else {
+ bool enabled = service->GetBoolean(prefs::kTouchVirtualKeyboardEnabled);
bartfab (slow) 2014/06/16 10:20:13 Nit: const.
rsadam 2014/06/16 13:45:34 Done.
+ keyboard::SetKeyboardShowOverride(
+ enabled ? keyboard::KEYBOARD_SHOW_OVERRIDE_ENABLED
+ : keyboard::KEYBOARD_SHOW_OVERRIDE_DISABLED);
+ }
+ #endif // !OS_CHROMEOS
+}
+
ash::ShelfItemStatus ChromeLauncherController::GetAppState(
const::std::string& app_id) {
ash::ShelfItemStatus status = ash::STATUS_CLOSED;
@@ -2030,6 +2046,10 @@ void ChromeLauncherController::AttachProfile(Profile* profile) {
prefs::kShelfPreferences,
base::Bind(&ChromeLauncherController::SetShelfBehaviorsFromPrefs,
base::Unretained(this)));
+ pref_change_registrar_.Add(
+ prefs::kTouchVirtualKeyboardEnabled,
+ base::Bind(&ChromeLauncherController::SetVirtualKeyboardBehaviorFromPrefs,
+ base::Unretained(this)));
}
void ChromeLauncherController::ReleaseProfile() {

Powered by Google App Engine
This is Rietveld 408576698