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

Unified Diff: ash/common/system/chromeos/ime_menu/ime_list_view.cc

Issue 2289223002: Make TrayDetailsView a ViewClickListener and ButtonListener (Closed)
Patch Set: rebase Created 4 years, 4 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/common/system/chromeos/ime_menu/ime_list_view.cc
diff --git a/ash/common/system/chromeos/ime_menu/ime_list_view.cc b/ash/common/system/chromeos/ime_menu/ime_list_view.cc
index a60d3106ad213a8ce81b13c79ffee3a32d607696..e515bb47c542c9500cc5a9e875769a9eb5b235a4 100644
--- a/ash/common/system/chromeos/ime_menu/ime_list_view.cc
+++ b/ash/common/system/chromeos/ime_menu/ime_list_view.cc
@@ -129,26 +129,27 @@ void ImeListView::AppendKeyboardStatus() {
keyboard_status_ = container;
}
-void ImeListView::OnViewClicked(views::View* sender) {
- SystemTrayDelegate* delegate = WmShell::Get()->system_tray_delegate();
- if (sender == keyboard_status_) {
+void ImeListView::HandleViewClicked(views::View* view) {
+ if (view == keyboard_status_) {
WmShell::Get()->ToggleIgnoreExternalKeyboard();
+ return;
+ }
+
+ SystemTrayDelegate* delegate = WmShell::Get()->system_tray_delegate();
+ std::map<views::View*, std::string>::const_iterator ime_find;
varkha 2016/08/31 20:28:14 Merge those two lines? Here and below for prop_fin
tdanderson 2016/08/31 22:24:15 Done.
+ ime_find = ime_map_.find(view);
+ if (ime_find != ime_map_.end()) {
+ WmShell::Get()->RecordUserMetricsAction(UMA_STATUS_AREA_IME_SWITCH_MODE);
+ std::string ime_id = ime_find->second;
+ delegate->SwitchIME(ime_id);
+ GetWidget()->Close();
varkha 2016/08/31 20:28:14 nit: This could be taken out of {} and done at the
tdanderson 2016/08/31 22:24:15 Done, but in a slightly different manner than sugg
} else {
- std::map<views::View*, std::string>::const_iterator ime_find;
- ime_find = ime_map_.find(sender);
- if (ime_find != ime_map_.end()) {
- WmShell::Get()->RecordUserMetricsAction(UMA_STATUS_AREA_IME_SWITCH_MODE);
- std::string ime_id = ime_find->second;
- delegate->SwitchIME(ime_id);
+ std::map<views::View*, std::string>::const_iterator prop_find;
+ prop_find = property_map_.find(view);
+ if (prop_find != property_map_.end()) {
+ const std::string key = prop_find->second;
+ delegate->ActivateIMEProperty(key);
GetWidget()->Close();
- } else {
- std::map<views::View*, std::string>::const_iterator prop_find;
- prop_find = property_map_.find(sender);
- if (prop_find != property_map_.end()) {
- const std::string key = prop_find->second;
- delegate->ActivateIMEProperty(key);
- GetWidget()->Close();
- }
}
}
}

Powered by Google App Engine
This is Rietveld 408576698