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

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

Issue 2738133003: Promotes a handful of members from WmShell to Shell (Closed)
Patch Set: merge Created 3 years, 9 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/tray/hover_highlight_view.h" 11 #include "ash/common/system/tray/hover_highlight_view.h"
12 #include "ash/common/system/tray/system_tray.h" 12 #include "ash/common/system/tray/system_tray.h"
13 #include "ash/common/system/tray/system_tray_controller.h" 13 #include "ash/common/system/tray/system_tray_controller.h"
14 #include "ash/common/system/tray/system_tray_delegate.h" 14 #include "ash/common/system/tray/system_tray_delegate.h"
15 #include "ash/common/system/tray/system_tray_notifier.h" 15 #include "ash/common/system/tray/system_tray_notifier.h"
16 #include "ash/common/system/tray/tray_constants.h" 16 #include "ash/common/system/tray/tray_constants.h"
17 #include "ash/common/system/tray/tray_details_view.h" 17 #include "ash/common/system/tray/tray_details_view.h"
18 #include "ash/common/system/tray/tray_item_more.h" 18 #include "ash/common/system/tray/tray_item_more.h"
19 #include "ash/common/system/tray/tray_item_view.h" 19 #include "ash/common/system/tray/tray_item_view.h"
20 #include "ash/common/system/tray/tray_popup_item_style.h" 20 #include "ash/common/system/tray/tray_popup_item_style.h"
21 #include "ash/common/system/tray/tray_popup_utils.h" 21 #include "ash/common/system/tray/tray_popup_utils.h"
22 #include "ash/common/system/tray/tray_utils.h" 22 #include "ash/common/system/tray/tray_utils.h"
23 #include "ash/common/system/tray/tri_view.h" 23 #include "ash/common/system/tray/tri_view.h"
24 #include "ash/common/system/tray_accessibility.h" 24 #include "ash/common/system/tray_accessibility.h"
25 #include "ash/common/wm_shell.h" 25 #include "ash/common/wm_shell.h"
26 #include "ash/resources/grit/ash_resources.h" 26 #include "ash/resources/grit/ash_resources.h"
27 #include "ash/resources/vector_icons/vector_icons.h" 27 #include "ash/resources/vector_icons/vector_icons.h"
28 #include "ash/shell.h"
28 #include "ash/strings/grit/ash_strings.h" 29 #include "ash/strings/grit/ash_strings.h"
29 #include "base/logging.h" 30 #include "base/logging.h"
30 #include "base/strings/utf_string_conversions.h" 31 #include "base/strings/utf_string_conversions.h"
31 #include "ui/accessibility/ax_enums.h" 32 #include "ui/accessibility/ax_enums.h"
32 #include "ui/accessibility/ax_node_data.h" 33 #include "ui/accessibility/ax_node_data.h"
33 #include "ui/base/l10n/l10n_util.h" 34 #include "ui/base/l10n/l10n_util.h"
34 #include "ui/base/resource/resource_bundle.h" 35 #include "ui/base/resource/resource_bundle.h"
35 #include "ui/gfx/font.h" 36 #include "ui/gfx/font.h"
36 #include "ui/gfx/image/image.h" 37 #include "ui/gfx/image/image.h"
37 #include "ui/gfx/paint_vector_icon.h" 38 #include "ui/gfx/paint_vector_icon.h"
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
267 base::UTF8ToUTF16("*")); 268 base::UTF8ToUTF16("*"));
268 } else { 269 } else {
269 tray_label_->label()->SetText(current.short_name); 270 tray_label_->label()->SetText(current.short_name);
270 } 271 }
271 SetTrayLabelItemBorder(tray_label_, system_tray()->shelf_alignment()); 272 SetTrayLabelItemBorder(tray_label_, system_tray()->shelf_alignment());
272 tray_label_->Layout(); 273 tray_label_->Layout();
273 } 274 }
274 } 275 }
275 276
276 bool TrayIME::ShouldShowKeyboardToggle() { 277 bool TrayIME::ShouldShowKeyboardToggle() {
277 return keyboard_suppressed_ && 278 return keyboard_suppressed_ && !Shell::GetInstance()
278 !WmShell::Get()->accessibility_delegate()->IsVirtualKeyboardEnabled(); 279 ->accessibility_delegate()
280 ->IsVirtualKeyboardEnabled();
279 } 281 }
280 282
281 base::string16 TrayIME::GetDefaultViewLabel(bool show_ime_label) { 283 base::string16 TrayIME::GetDefaultViewLabel(bool show_ime_label) {
282 if (show_ime_label) { 284 if (show_ime_label) {
283 IMEInfo current; 285 IMEInfo current;
284 WmShell::Get()->system_tray_delegate()->GetCurrentIME(&current); 286 WmShell::Get()->system_tray_delegate()->GetCurrentIME(&current);
285 return current.name; 287 return current.name;
286 } else { 288 } else {
287 // Display virtual keyboard status instead. 289 // Display virtual keyboard status instead.
288 int id = keyboard::IsKeyboardEnabled() 290 int id = keyboard::IsKeyboardEnabled()
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
376 return ime_count >= threshold; 378 return ime_count >= threshold;
377 } 379 }
378 380
379 ImeListView::SingleImeBehavior TrayIME::GetSingleImeBehavior() { 381 ImeListView::SingleImeBehavior TrayIME::GetSingleImeBehavior() {
380 // If managed, we also want to show a single IME. 382 // If managed, we also want to show a single IME.
381 return IsIMEManaged() ? ImeListView::SHOW_SINGLE_IME 383 return IsIMEManaged() ? ImeListView::SHOW_SINGLE_IME
382 : ImeListView::HIDE_SINGLE_IME; 384 : ImeListView::HIDE_SINGLE_IME;
383 } 385 }
384 386
385 } // namespace ash 387 } // namespace ash
OLDNEW
« no previous file with comments | « ash/common/system/chromeos/tray_caps_lock.cc ('k') | ash/common/system/ime/tray_ime_chromeos_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698