summaryrefslogtreecommitdiffstats
path: root/ash
diff options
context:
space:
mode:
authormukai@chromium.org <mukai@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-10 18:01:15 +0000
committermukai@chromium.org <mukai@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-10 18:01:15 +0000
commite36d2490055b26ce0bac3a61e13d29a94ceb5237 (patch)
tree9cba0574c95c408cb0e6225eb0190295db9f10c6 /ash
parent78b71b8f2cac334cff09fbc3df1ce28b46be1a42 (diff)
downloadchromium_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
Diffstat (limited to 'ash')
-rw-r--r--ash/shell.cc3
-rw-r--r--ash/system/ime/tray_ime.cc11
-rw-r--r--ash/system/tray/system_tray.cc3
-rw-r--r--ash/system/tray/system_tray_delegate.h7
4 files changed, 15 insertions, 9 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