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

Unified Diff: ash/system/ime/tray_ime.cc

Issue 10008043: Allow non-radio button properties in uber tray. Simplified chinese will use it. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rewrite ActivateIMEProperty Created 8 years, 8 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
Index: ash/system/ime/tray_ime.cc
diff --git a/ash/system/ime/tray_ime.cc b/ash/system/ime/tray_ime.cc
index 6e0ac615afcce06673dd9c2e6310800c7355d09e..3b6fea86cefba527e4eab1af258ec092b9ae32af 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,8 @@ 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] =
+ std::make_pair(property_list[i].key, property_list[i].is_selection);
}
properties->set_border(views::Border::CreateSolidSidedBorder(
0, 0, 1, 0, kBorderLightColor));
@@ -153,11 +155,11 @@ class IMEDetailedView : public views::View,
delegate->SwitchIME(ime_id);
GetWidget()->Close();
} else {
- std::map<views::View*, std::string>::const_iterator prop_find;
- prop_find = property_map_.find(sender);
+ std::map<views::View*, std::pair<std::string, bool> >::const_iterator
+ prop_find = property_map_.find(sender);
if (prop_find != property_map_.end()) {
- std::string key = prop_find->second;
- delegate->ActivateIMEProperty(key);
+ const std::pair<std::string, bool>& prop = prop_find->second;
+ delegate->ActivateIMEProperty(prop.first, prop.second);
GetWidget()->Close();
}
}
@@ -167,7 +169,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*, std::pair<std::string, bool> > property_map_;
sky 2012/04/09 15:18:56 Document what the pair is.
Jun Mukai 2012/04/10 02:13:46 Use IMEPropertyInfo struct instead.
views::View* header_;
views::View* settings_;

Powered by Google App Engine
This is Rietveld 408576698