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

Unified Diff: chrome/browser/chromeos/chrome_browser_main_chromeos.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
« no previous file with comments | « chrome/browser/chromeos/base/locale_util.cc ('k') | chrome/browser/chromeos/extensions/input_method_api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « chrome/browser/chromeos/base/locale_util.cc ('k') | chrome/browser/chromeos/extensions/input_method_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698