Index: ash/system/ime_menu/ime_list_view.cc |
diff --git a/ash/system/ime_menu/ime_list_view.cc b/ash/system/ime_menu/ime_list_view.cc |
index 4d9cf07ade0cb4b146108ca996e8c3368df5b45f..d93455aca0523004442c0005d2fef19e3f1a5e78 100644 |
--- a/ash/system/ime_menu/ime_list_view.cc |
+++ b/ash/system/ime_menu/ime_list_view.cc |
@@ -4,6 +4,7 @@ |
#include "ash/system/ime_menu/ime_list_view.h" |
+#include "ash/ime/ime_switch_type.h" |
#include "ash/resources/grit/ash_resources.h" |
#include "ash/resources/vector_icons/vector_icons.h" |
#include "ash/shell.h" |
@@ -19,7 +20,9 @@ |
#include "ash/system/tray/tray_popup_item_style.h" |
#include "ash/system/tray/tray_popup_utils.h" |
#include "ash/system/tray/tri_view.h" |
+#include "base/metrics/histogram_macros.h" |
#include "ui/accessibility/ax_node_data.h" |
+#include "ui/base/ime/chromeos/input_method_manager.h" |
#include "ui/base/l10n/l10n_util.h" |
#include "ui/base/resource/resource_bundle.h" |
#include "ui/gfx/color_palette.h" |
@@ -35,6 +38,8 @@ |
#include "ui/views/view.h" |
#include "ui/views/widget/widget.h" |
+using chromeos::input_method::InputMethodManager; |
+ |
namespace ash { |
namespace { |
@@ -290,13 +295,16 @@ void ImeListView::PrependKeyboardStatusRow() { |
} |
void ImeListView::HandleViewClicked(views::View* view) { |
- SystemTrayDelegate* delegate = Shell::Get()->system_tray_delegate(); |
std::map<views::View*, std::string>::const_iterator ime = ime_map_.find(view); |
if (ime != ime_map_.end()) { |
ShellPort::Get()->RecordUserMetricsAction(UMA_STATUS_AREA_IME_SWITCH_MODE); |
std::string ime_id = ime->second; |
last_selected_item_id_ = ime_id; |
- delegate->SwitchIME(ime_id); |
+ InputMethodManager::Get()->GetActiveIMEState()->ChangeInputMethod( |
+ ime_id, false /* show_message */); |
+ UMA_HISTOGRAM_ENUMERATION("InputMethod.ImeSwitch", ImeSwitchType::kTray, |
+ ImeSwitchType::kCount); |
+ |
} else { |
std::map<views::View*, std::string>::const_iterator property = |
property_map_.find(view); |
@@ -304,7 +312,7 @@ void ImeListView::HandleViewClicked(views::View* view) { |
return; |
const std::string key = property->second; |
last_selected_item_id_ = key; |
- delegate->ActivateIMEProperty(key); |
+ InputMethodManager::Get()->ActivateInputMethodMenuItem(key); |
} |
if (!should_focus_ime_after_selection_with_keyboard_ || |