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

Unified Diff: chrome/browser/chromeos/base/locale_util.cc

Issue 419293002: IME refactoring: ChromeOS introduce input methods State. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Unit test fixed. Re-sorted methods of StateImpl and IMM. Created 6 years, 4 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/base/locale_util.cc
diff --git a/chrome/browser/chromeos/base/locale_util.cc b/chrome/browser/chromeos/base/locale_util.cc
index 6907df02f8ef5a3e8a9d22f5147b8d643be835d5..57d23a84cfe376b2c8e4fb5a4c755dc212477576 100644
--- a/chrome/browser/chromeos/base/locale_util.cc
+++ b/chrome/browser/chromeos/base/locale_util.cc
@@ -59,18 +59,20 @@ void FinishSwitchLanguage(scoped_ptr<SwitchLanguageData> data) {
if (data->enable_locale_keyboard_layouts) {
input_method::InputMethodManager* manager =
input_method::InputMethodManager::Get();
+ scoped_refptr<input_method::InputMethodManager::State> ime_state =
+ manager->GetActiveIMEState();
if (data->login_layouts_only) {
// Enable the hardware keyboard layouts and locale-specific layouts
// suitable for use on the login screen. This will also switch to the
// first hardware keyboard layout since the input method currently in
// use may not be supported by the new locale.
- manager->EnableLoginLayouts(
+ ime_state->EnableLoginLayouts(
data->loaded_locale,
manager->GetInputMethodUtil()->GetHardwareLoginInputMethodIds());
} else {
// Enable all hardware keyboard layouts. This will also switch to the
// first hardware keyboard layout.
- manager->ReplaceEnabledInputMethods(
+ ime_state->ReplaceEnabledInputMethods(
manager->GetInputMethodUtil()->GetHardwareInputMethodIds());
// Enable all locale-specific layouts.
@@ -81,7 +83,7 @@ void FinishSwitchLanguage(scoped_ptr<SwitchLanguageData> data) {
&input_methods);
for (std::vector<std::string>::const_iterator it =
input_methods.begin(); it != input_methods.end(); ++it) {
- manager->EnableInputMethod(*it);
+ ime_state->EnableInputMethod(*it);
}
}
}

Powered by Google App Engine
This is Rietveld 408576698