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

Side by Side Diff: ash/common/system/ime/tray_ime_chromeos.cc

Issue 2395523002: chromeos: Refactor system tray "show settings" commands to use mojo (Closed)
Patch Set: Created 4 years, 2 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ash/common/system/ime/tray_ime_chromeos.h" 5 #include "ash/common/system/ime/tray_ime_chromeos.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "ash/common/material_design/material_design_controller.h" 9 #include "ash/common/material_design/material_design_controller.h"
10 #include "ash/common/session/session_state_delegate.h" 10 #include "ash/common/session/session_state_delegate.h"
11 #include "ash/common/system/chromeos/ime_menu/ime_list_view.h" 11 #include "ash/common/system/chromeos/ime_menu/ime_list_view.h"
12 #include "ash/common/system/tray/hover_highlight_view.h" 12 #include "ash/common/system/tray/hover_highlight_view.h"
13 #include "ash/common/system/tray/system_tray.h" 13 #include "ash/common/system/tray/system_tray.h"
14 #include "ash/common/system/tray/system_tray_controller.h"
14 #include "ash/common/system/tray/system_tray_delegate.h" 15 #include "ash/common/system/tray/system_tray_delegate.h"
15 #include "ash/common/system/tray/system_tray_notifier.h" 16 #include "ash/common/system/tray/system_tray_notifier.h"
16 #include "ash/common/system/tray/tray_constants.h" 17 #include "ash/common/system/tray/tray_constants.h"
17 #include "ash/common/system/tray/tray_details_view.h" 18 #include "ash/common/system/tray/tray_details_view.h"
18 #include "ash/common/system/tray/tray_item_more.h" 19 #include "ash/common/system/tray/tray_item_more.h"
19 #include "ash/common/system/tray/tray_item_view.h" 20 #include "ash/common/system/tray/tray_item_view.h"
20 #include "ash/common/system/tray/tray_popup_item_style.h" 21 #include "ash/common/system/tray/tray_popup_item_style.h"
21 #include "ash/common/system/tray/tray_utils.h" 22 #include "ash/common/system/tray/tray_utils.h"
22 #include "ash/common/system/tray_accessibility.h" 23 #include "ash/common/system/tray_accessibility.h"
23 #include "ash/common/wm_shell.h" 24 #include "ash/common/wm_shell.h"
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 CreateTitleRow(IDS_ASH_STATUS_TRAY_IME); 141 CreateTitleRow(IDS_ASH_STATUS_TRAY_IME);
141 } 142 }
142 143
143 private: 144 private:
144 // ImeListView: 145 // ImeListView:
145 void HandleViewClicked(views::View* view) override { 146 void HandleViewClicked(views::View* view) override {
146 ImeListView::HandleViewClicked(view); 147 ImeListView::HandleViewClicked(view);
147 if (view == settings_) { 148 if (view == settings_) {
148 WmShell::Get()->RecordUserMetricsAction( 149 WmShell::Get()->RecordUserMetricsAction(
149 UMA_STATUS_AREA_IME_SHOW_DETAILED); 150 UMA_STATUS_AREA_IME_SHOW_DETAILED);
150 WmShell::Get()->system_tray_delegate()->ShowIMESettings(); 151 WmShell::Get()->system_tray_controller()->ShowIMESettings();
151 } 152 }
152 } 153 }
153 154
154 void AppendSettings() { 155 void AppendSettings() {
155 HoverHighlightView* container = new HoverHighlightView(this); 156 HoverHighlightView* container = new HoverHighlightView(this);
156 container->AddLabel( 157 container->AddLabel(
157 ui::ResourceBundle::GetSharedInstance().GetLocalizedString( 158 ui::ResourceBundle::GetSharedInstance().GetLocalizedString(
158 IDS_ASH_STATUS_TRAY_IME_SETTINGS), 159 IDS_ASH_STATUS_TRAY_IME_SETTINGS),
159 gfx::ALIGN_LEFT, false /* highlight */); 160 gfx::ALIGN_LEFT, false /* highlight */);
160 AddChildView(container); 161 AddChildView(container);
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 else 313 else
313 Update(); 314 Update();
314 } 315 }
315 316
316 bool TrayIME::ShouldDefaultViewBeVisible() { 317 bool TrayIME::ShouldDefaultViewBeVisible() {
317 return is_visible_ && (ime_list_.size() > 1 || property_list_.size() > 1 || 318 return is_visible_ && (ime_list_.size() > 1 || property_list_.size() > 1 ||
318 ShouldShowKeyboardToggle()); 319 ShouldShowKeyboardToggle());
319 } 320 }
320 321
321 } // namespace ash 322 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698