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

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

Issue 2891263002: chromeos: Remove some IME methods from ash::SystemTrayDelegate (Closed)
Patch Set: rebase Created 3 years, 7 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
« no previous file with comments | « ash/ime_control_delegate.h ('k') | ash/system/tray/system_tray_delegate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_ ||
« no previous file with comments | « ash/ime_control_delegate.h ('k') | ash/system/tray/system_tray_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698