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 70d37a83b620daf9a44167282d7ef618a8e290f6..f10896088d8a56014f7d3e1cf6881b58e4c423e2 100644 |
--- a/chrome/browser/chromeos/chrome_browser_main_chromeos.cc |
+++ b/chrome/browser/chromeos/chrome_browser_main_chromeos.cc |
@@ -459,31 +459,34 @@ void GuestLanguageSetCallbackData::Callback( |
const std::string& locale, |
const std::string& loaded_locale, |
bool success) { |
- input_method::InputMethodManager* const ime_manager = |
+ input_method::InputMethodManager* manager = |
input_method::InputMethodManager::Get(); |
+ scoped_refptr<input_method::InputMethodManager::State> ime_state = |
+ manager->GetActiveIMEState(); |
// Active layout must be hardware "login layout". |
// The previous one must be "locale default layout". |
// First, enable all hardware input methods. |
const std::vector<std::string>& input_methods = |
- ime_manager->GetInputMethodUtil()->GetHardwareInputMethodIds(); |
+ manager->GetInputMethodUtil()->GetHardwareInputMethodIds(); |
for (size_t i = 0; i < input_methods.size(); ++i) |
- ime_manager->EnableInputMethod(input_methods[i]); |
+ ime_state->EnableInputMethod(input_methods[i]); |
// Second, enable locale based input methods. |
const std::string locale_default_input_method = |
- ime_manager->GetInputMethodUtil()-> |
- GetLanguageDefaultInputMethodId(loaded_locale); |
+ manager->GetInputMethodUtil()->GetLanguageDefaultInputMethodId( |
+ loaded_locale); |
if (!locale_default_input_method.empty()) { |
PrefService* user_prefs = self->profile->GetPrefs(); |
user_prefs->SetString(prefs::kLanguagePreviousInputMethod, |
locale_default_input_method); |
- ime_manager->EnableInputMethod(locale_default_input_method); |
+ ime_state->EnableInputMethod(locale_default_input_method); |
} |
// Finally, activate the first login input method. |
const std::vector<std::string>& login_input_methods = |
- ime_manager->GetInputMethodUtil()->GetHardwareLoginInputMethodIds(); |
- ime_manager->ChangeInputMethod(login_input_methods[0]); |
+ manager->GetInputMethodUtil()->GetHardwareLoginInputMethodIds(); |
+ ime_state->ChangeInputMethod(login_input_methods[0], |
+ false /* show_message */); |
} |
void SetGuestLocale(Profile* const profile) { |
@@ -524,6 +527,15 @@ void ChromeBrowserMainPartsChromeos::PostProfileInit() { |
detector->Enable(true); |
} |
+ // Initialize input methods. |
+ input_method::InputMethodManager* manager = |
+ input_method::InputMethodManager::Get(); |
+ UserSessionManager* session_manager = UserSessionManager::GetInstance(); |
+ DCHECK(manager); |
+ DCHECK(session_manager); |
+ |
+ manager->SetState(session_manager->GetDefaultIMEState(profile())); |
+ |
bool is_running_test = parameters().ui_task != NULL; |
g_browser_process->platform_part()->InitializeSessionManager( |
parsed_command_line(), profile(), is_running_test); |