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

Unified Diff: chrome/browser/chromeos/chrome_browser_main_chromeos.cc

Issue 139803010: Support comma separated hardware keyboard layout. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressing comments 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/chrome_browser_main_chromeos.cc
diff --git a/chrome/browser/chromeos/chrome_browser_main_chromeos.cc b/chrome/browser/chromeos/chrome_browser_main_chromeos.cc
index d1f76ce88417c1175de246f15e5ba50e0997af21..2a19379d435c52a69f912096455648ea1c978696 100644
--- a/chrome/browser/chromeos/chrome_browser_main_chromeos.cc
+++ b/chrome/browser/chromeos/chrome_browser_main_chromeos.cc
@@ -580,10 +580,13 @@ void GuestLanguageSetCallbackData::Callback(
input_method::InputMethodManager::Get();
// Active layout must be hardware "login layout".
// The previous one must be "locale default layout".
- const std::string login_input_method =
- ime_manager->GetInputMethodUtil()->GetHardwareLoginInputMethodId();
- ime_manager->ChangeInputMethod(login_input_method);
+ // First, enable all hardware input methods.
+ const std::vector<std::string>& input_methods =
+ ime_manager->GetInputMethodUtil()->GetHardwareInputMethodIds();
+ for (size_t i = 0; i < input_methods.size(); ++i)
+ ime_manager->EnableInputMethod(input_methods[i]);
+ // Seconds, enable locale based input methods.
Alexander Alekseev 2014/02/13 12:47:04 nit: Second
Seigo Nonaka 2014/02/14 03:51:45 Done.
const std::string locale_default_input_method =
ime_manager->GetInputMethodUtil()->
GetLanguageDefaultInputMethodId(loaded_locale);
@@ -591,7 +594,15 @@ void GuestLanguageSetCallbackData::Callback(
PrefService* user_prefs = self->profile->GetPrefs();
user_prefs->SetString(prefs::kLanguagePreviousInputMethod,
locale_default_input_method);
+ ime_manager->EnableInputMethod(locale_default_input_method);
}
+
+ // Finally, actrivate the first login input method.
+ const std::vector<std::string>& login_input_methods =
+ ime_manager->GetInputMethodUtil()->GetHardwareLoginInputMethodIds();
+ for (size_t i = 0; i < login_input_methods.size(); ++i)
+ LOG(ERROR) << login_input_methods[i];
Alexander Alekseev 2014/02/13 12:47:04 Remove debug?
Seigo Nonaka 2014/02/14 03:51:45 Yes, I'm sorry... Removed. On 2014/02/13 12:47:0
+ ime_manager->ChangeInputMethod(login_input_methods[0]);
}
void SetGuestLocale(UserManager* const usermanager, Profile* const profile) {

Powered by Google App Engine
This is Rietveld 408576698