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

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

Issue 9852008: Update IME preferences outside the IME status button when Uber Tray is in use. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: retry Created 8 years, 9 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/preferences.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/preferences.cc
diff --git a/chrome/browser/chromeos/preferences.cc b/chrome/browser/chromeos/preferences.cc
index 2bf3b67d17e44d319fcdf21221e021dc4e0e628c..2e47f401fea9c6eecea05f909e2c7abe5efb44ab 100644
--- a/chrome/browser/chromeos/preferences.cc
+++ b/chrome/browser/chromeos/preferences.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/chromeos/preferences.h"
+#include "ash/ash_switches.h"
#include "base/chromeos/chromeos_version.h"
#include "base/command_line.h"
#include "base/i18n/time_formatting.h"
@@ -266,8 +267,11 @@ void Preferences::Init(PrefService* prefs) {
hotkey_previous_engine_.Init(
prefs::kLanguageHotkeyPreviousEngine, prefs, this);
preferred_languages_.Init(prefs::kLanguagePreferredLanguages,
- prefs, this);
+ prefs, this);
preload_engines_.Init(prefs::kLanguagePreloadEngines, prefs, this);
+ current_input_method_.Init(prefs::kLanguageCurrentInputMethod, prefs, this);
+ previous_input_method_.Init(prefs::kLanguagePreviousInputMethod, prefs, this);
+
for (size_t i = 0; i < language_prefs::kNumChewingBooleanPrefs; ++i) {
chewing_boolean_prefs_[i].Init(
language_prefs::kChewingBooleanPrefs[i].pref_name, prefs, this);
@@ -423,6 +427,27 @@ void Preferences::NotifyPrefChanged(const std::string* pref_name) {
language_prefs::kPreloadEnginesConfigName,
preload_engines_.GetValue());
}
+
+ // Do not check |*pref_name| for the two prefs. We're only interested in
+ // initial values of the prefs.
+ // TODO(yusukes): Remove the second condition on R20.
+ if (!pref_name && !CommandLine::ForCurrentProcess()->HasSwitch(
+ ash::switches::kDisableAshUberTray)) {
+ const std::string previous_input_method_id =
+ previous_input_method_.GetValue();
+ const std::string current_input_method_id =
+ current_input_method_.GetValue();
+ // NOTICE: ChangeInputMethod() has to be called AFTER the value of
+ // |preload_engines_| is sent to the InputMethodManager. Otherwise, the
+ // ChangeInputMethod request might be ignored as an invalid input method ID.
+ input_method::InputMethodManager* manager =
+ input_method::InputMethodManager::GetInstance();
+ if (!previous_input_method_id.empty())
+ manager->ChangeInputMethod(previous_input_method_id);
+ if (!current_input_method_id.empty())
+ manager->ChangeInputMethod(current_input_method_id);
+ }
+
for (size_t i = 0; i < language_prefs::kNumChewingBooleanPrefs; ++i) {
if (!pref_name ||
*pref_name == language_prefs::kChewingBooleanPrefs[i].pref_name) {
« no previous file with comments | « chrome/browser/chromeos/preferences.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698