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

Unified Diff: chrome/browser/chromeos/login/login_display_host_impl.cc

Issue 139803010: Support comma separated hardware keyboard layout. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: /EnableInputMethods/ReplaceEnabeldInputMethods/ Created 6 years, 10 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/chromeos/login/login_display_host_impl.cc
diff --git a/chrome/browser/chromeos/login/login_display_host_impl.cc b/chrome/browser/chromeos/login/login_display_host_impl.cc
index 20b6774403895593c056b7af71400cf8f194272c..708d0670defe1b7d6d292bbbd4dec3b5300dda8c 100644
--- a/chrome/browser/chromeos/login/login_display_host_impl.cc
+++ b/chrome/browser/chromeos/login/login_display_host_impl.cc
@@ -147,11 +147,17 @@ void DetermineAndSaveHardwareKeyboard(const std::string& locale,
if (!layout.empty()) {
PrefService* prefs = g_browser_process->local_state();
prefs->SetString(prefs::kHardwareKeyboardLayout, layout);
+
// This asks the file thread to save the prefs (i.e. doesn't block).
// The latest values of Local State reside in memory so we can safely
// get the value of kHardwareKeyboardLayout even if the data is not
// yet saved to disk.
prefs->CommitPendingWrite();
+
+ chromeos::input_method::InputMethodManager* manager =
+ chromeos::input_method::InputMethodManager::Get();
+ manager->GetInputMethodUtil()->UpdateHardwareLayoutCache();
+ manager->SetInputMethodLoginDefault();
}
}
@@ -1078,7 +1084,7 @@ void ShowLoginWizard(const std::string& first_screen_name) {
// Set up keyboards. For example, when |locale| is "en-US", enable US qwerty
// and US dvorak keyboard layouts.
if (g_browser_process && g_browser_process->local_state()) {
- manager->SetInputMethodDefault();
+ manager->SetInputMethodLoginDefault();
PrefService* prefs = g_browser_process->local_state();
// Apply owner preferences for tap-to-click and mouse buttons swap for
@@ -1145,7 +1151,8 @@ void ShowLoginWizard(const std::string& first_screen_name) {
std::string locale = chromeos::StartupUtils::GetInitialLocale();
prefs->SetString(prefs::kApplicationLocale, locale);
manager->EnableLoginLayouts(
- locale, manager->GetInputMethodUtil()->GetHardwareInputMethodId());
+ locale,
+ manager->GetInputMethodUtil()->GetHardwareInputMethodIds());
base::ThreadRestrictions::ScopedAllowIO allow_io;
const std::string loaded_locale =
ResourceBundle::GetSharedInstance().ReloadLocaleResources(locale);
@@ -1169,14 +1176,18 @@ void ShowLoginWizard(const std::string& first_screen_name) {
VLOG(1) << "Current locale: " << current_locale;
std::string locale = startup_manifest->initial_locale_default();
+ std::string layout = startup_manifest->keyboard_layout();
+ VLOG(1) << "Initial locale: " << locale << "keyboard layout " << layout;
+
+ // Determine keyboard layout from OEM customization (if provided) or
+ // initial locale and save it in preferences.
+ DetermineAndSaveHardwareKeyboard(locale, layout);
+
if (!current_locale.empty() || locale.empty()) {
ShowLoginWizardFinish(first_screen_name, startup_manifest, display_host);
return;
}
- std::string layout = startup_manifest->keyboard_layout();
- VLOG(1) << "Initial locale: " << locale << "keyboard layout " << layout;
-
// Save initial locale from VPD/customization manifest as current
// Chrome locale. Otherwise it will be lost if Chrome restarts.
// Don't need to schedule pref save because setting initial local
@@ -1184,10 +1195,6 @@ void ShowLoginWizard(const std::string& first_screen_name) {
prefs->SetString(prefs::kApplicationLocale, locale);
chromeos::StartupUtils::SetInitialLocale(locale);
- // Determine keyboard layout from OEM customization (if provided) or
- // initial locale and save it in preferences.
- DetermineAndSaveHardwareKeyboard(locale, layout);
-
scoped_ptr<ShowLoginWizardSwitchLanguageCallbackData> data(
new ShowLoginWizardSwitchLanguageCallbackData(
first_screen_name, startup_manifest, display_host));
« no previous file with comments | « chrome/browser/chromeos/input_method/mode_indicator_browsertest.cc ('k') | chrome/browser/chromeos/preferences.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698