diff options
author | mukai@chromium.org <mukai@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-10 18:01:15 +0000 |
---|---|---|
committer | mukai@chromium.org <mukai@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-10 18:01:15 +0000 |
commit | e36d2490055b26ce0bac3a61e13d29a94ceb5237 (patch) | |
tree | 9cba0574c95c408cb0e6225eb0190295db9f10c6 | |
parent | 78b71b8f2cac334cff09fbc3df1ce28b46be1a42 (diff) | |
download | chromium_src-e36d2490055b26ce0bac3a61e13d29a94ceb5237.zip chromium_src-e36d2490055b26ce0bac3a61e13d29a94ceb5237.tar.gz chromium_src-e36d2490055b26ce0bac3a61e13d29a94ceb5237.tar.bz2 |
Allow non-radio button properties in uber tray. Simplified chinese will use it.
BUG=122318
TEST=manually
Review URL: http://codereview.chromium.org/10008043
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@131583 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | ash/shell.cc | 3 | ||||
-rw-r--r-- | ash/system/ime/tray_ime.cc | 11 | ||||
-rw-r--r-- | ash/system/tray/system_tray.cc | 3 | ||||
-rw-r--r-- | ash/system/tray/system_tray_delegate.h | 7 | ||||
-rw-r--r-- | chrome/browser/chromeos/system/ash_system_tray_delegate.cc | 9 |
5 files changed, 19 insertions, 14 deletions
diff --git a/ash/shell.cc b/ash/shell.cc index d246e6c..4dfb483 100644 --- a/ash/shell.cc +++ b/ash/shell.cc @@ -377,7 +377,8 @@ class DummySystemTrayDelegate : public SystemTrayDelegate { virtual void SwitchIME(const std::string& ime_id) OVERRIDE { } - virtual void ActivateIMEProperty(const std::string& key) OVERRIDE { + virtual void ActivateIMEProperty(const std::string& key, + bool is_selection) OVERRIDE { } virtual void GetMostRelevantNetworkIcon(NetworkIconInfo* info, diff --git a/ash/system/ime/tray_ime.cc b/ash/system/ime/tray_ime.cc index 6e0ac61..8c43ad3 100644 --- a/ash/system/ime/tray_ime.cc +++ b/ash/system/ime/tray_ime.cc @@ -4,6 +4,7 @@ #include "ash/system/ime/tray_ime.h" +#include <utility> #include <vector> #include "ash/shell.h" @@ -122,7 +123,7 @@ class IMEDetailedView : public views::View, property_list[i].name, property_list[i].selected ? gfx::Font::BOLD : gfx::Font::NORMAL); properties->AddChildView(container); - property_map_[container] = property_list[i].key; + property_map_[container] = property_list[i]; } properties->set_border(views::Border::CreateSolidSidedBorder( 0, 0, 1, 0, kBorderLightColor)); @@ -153,11 +154,11 @@ class IMEDetailedView : public views::View, delegate->SwitchIME(ime_id); GetWidget()->Close(); } else { - std::map<views::View*, std::string>::const_iterator prop_find; + std::map<views::View*, IMEPropertyInfo>::const_iterator prop_find; prop_find = property_map_.find(sender); if (prop_find != property_map_.end()) { - std::string key = prop_find->second; - delegate->ActivateIMEProperty(key); + const IMEPropertyInfo& prop = prop_find->second; + delegate->ActivateIMEProperty(prop.key, prop.is_selection); GetWidget()->Close(); } } @@ -167,7 +168,7 @@ class IMEDetailedView : public views::View, user::LoginStatus login_; std::map<views::View*, std::string> ime_map_; - std::map<views::View*, std::string> property_map_; + std::map<views::View*, IMEPropertyInfo> property_map_; views::View* header_; views::View* settings_; diff --git a/ash/system/tray/system_tray.cc b/ash/system/tray/system_tray.cc index 23a3df2..cbd8259 100644 --- a/ash/system/tray/system_tray.cc +++ b/ash/system/tray/system_tray.cc @@ -431,7 +431,8 @@ IMEInfo::~IMEInfo() { } IMEPropertyInfo::IMEPropertyInfo() - : selected(false) { + : selected(false), + is_selection(false) { } IMEPropertyInfo::~IMEPropertyInfo() { diff --git a/ash/system/tray/system_tray_delegate.h b/ash/system/tray/system_tray_delegate.h index 420fd2da..dbc5722 100644 --- a/ash/system/tray/system_tray_delegate.h +++ b/ash/system/tray/system_tray_delegate.h @@ -48,6 +48,7 @@ struct ASH_EXPORT IMEPropertyInfo { ~IMEPropertyInfo(); bool selected; + bool is_selection; std::string key; string16 name; }; @@ -157,8 +158,10 @@ class SystemTrayDelegate { // Switches to the selected input method. virtual void SwitchIME(const std::string& ime_id) = 0; - // Activates an IME property. - virtual void ActivateIMEProperty(const std::string& key) = 0; + // Activates an IME property. Specify true to |is_selection| if it's a + // selection item. + virtual void ActivateIMEProperty( + const std::string& key, bool is_selection) = 0; // Returns information about the most relevant network. Relevance is // determined by the implementor (e.g. a connecting network may be more diff --git a/chrome/browser/chromeos/system/ash_system_tray_delegate.cc b/chrome/browser/chromeos/system/ash_system_tray_delegate.cc index 85984fb..10887c8 100644 --- a/chrome/browser/chromeos/system/ash_system_tray_delegate.cc +++ b/chrome/browser/chromeos/system/ash_system_tray_delegate.cc @@ -376,12 +376,10 @@ class SystemTrayDelegate : public ash::SystemTrayDelegate, manager->GetCurrentInputMethodProperties(); for (size_t i = 0; i < properties.size(); ++i) { ash::IMEPropertyInfo property; - // Do not show the item not in the selection item. - if (!properties[i].is_selection_item) - continue; property.key = properties[i].key; property.name = util->TranslateString(properties[i].label); property.selected = properties[i].is_selection_item_checked; + property.is_selection = properties[i].is_selection_item; list->push_back(property); } } @@ -390,9 +388,10 @@ class SystemTrayDelegate : public ash::SystemTrayDelegate, input_method::InputMethodManager::GetInstance()->ChangeInputMethod(ime_id); } - virtual void ActivateIMEProperty(const std::string& key) OVERRIDE { + virtual void ActivateIMEProperty( + const std::string& key, bool is_selection) OVERRIDE { input_method::InputMethodManager::GetInstance()->SetImePropertyActivated( - key, true); + key, is_selection); } virtual void GetMostRelevantNetworkIcon(ash::NetworkIconInfo* info, |