diff options
author | oshima@google.com <oshima@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-11 21:10:21 +0000 |
---|---|---|
committer | oshima@google.com <oshima@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-11 21:10:21 +0000 |
commit | 5ce5e887daa1ac7cf5a027082ff2c16e3eeb402f (patch) | |
tree | b7cf4c7b8776381f7de272039ee013acd2e62749 | |
parent | 8765a818db4bc9439d074f06ee47f030bf26c5b8 (diff) | |
download | chromium_src-5ce5e887daa1ac7cf5a027082ff2c16e3eeb402f.zip chromium_src-5ce5e887daa1ac7cf5a027082ff2c16e3eeb402f.tar.gz chromium_src-5ce5e887daa1ac7cf5a027082ff2c16e3eeb402f.tar.bz2 |
Update open input method drop-down when locale is changed.
BUG=none
TEST=Open input method drop-down, press alt-shift, observe selected input method changed in drop-down.
oshima landed for vsevik
Review URL: http://codereview.chromium.org/6246138
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@74667 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/chromeos/status/input_method_menu.cc | 5 | ||||
-rw-r--r-- | chrome/browser/chromeos/status/input_method_menu.h | 5 |
2 files changed, 9 insertions, 1 deletions
diff --git a/chrome/browser/chromeos/status/input_method_menu.cc b/chrome/browser/chromeos/status/input_method_menu.cc index 6980888..209b4a2 100644 --- a/chrome/browser/chromeos/status/input_method_menu.cc +++ b/chrome/browser/chromeos/status/input_method_menu.cc @@ -371,6 +371,7 @@ void InputMethodMenu::InputMethodChanged( const InputMethodDescriptor& current_input_method, size_t num_active_input_methods) { UpdateUIFromInputMethod(current_input_method, num_active_input_methods); + PrepareMenu(); } void InputMethodMenu::PreferenceUpdateNeeded( @@ -418,6 +419,10 @@ void InputMethodMenu::FirstObserverIsAdded(InputMethodLibrary* obj) { void InputMethodMenu::PrepareForMenuOpen() { UserMetrics::RecordAction(UserMetricsAction("LanguageMenuButton_Open")); + PrepareMenu(); +} + +void InputMethodMenu::PrepareMenu() { input_method_descriptors_.reset(CrosLibrary::Get()->GetInputMethodLibrary()-> GetActiveInputMethods()); RebuildModel(); diff --git a/chrome/browser/chromeos/status/input_method_menu.h b/chrome/browser/chromeos/status/input_method_menu.h index 53c0fb5..0d74bd4 100644 --- a/chrome/browser/chromeos/status/input_method_menu.h +++ b/chrome/browser/chromeos/status/input_method_menu.h @@ -97,7 +97,7 @@ class InputMethodMenu : public views::ViewMenuDelegate, static std::wstring GetTextForMenu(const InputMethodDescriptor& input_method); protected: - // Rebuilds model and menu2 objects in preparetion to open the menu. + // Prepares menu: saves user metrics and rebuilds. void PrepareForMenuOpen(); // Returns menu2 object for language menu. @@ -106,6 +106,9 @@ class InputMethodMenu : public views::ViewMenuDelegate, } private: + // Rebuilds model and menu2 objects. + void PrepareMenu(); + // Updates UI of a container of the menu (e.g. the "US" menu button in the // status area). Sub classes have to implement the interface for their own UI. virtual void UpdateUI(const std::string& input_method_id, // e.g. "mozc" |