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

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

Issue 2251643011: Move Ash-specific vector icons to ash/common/resources (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix sources again Created 4 years, 3 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
« no previous file with comments | « ash/common/DEPS ('k') | ash/resources/vector_icons/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_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_utils.h" 20 #include "ash/common/system/tray/tray_utils.h"
21 #include "ash/common/system/tray_accessibility.h" 21 #include "ash/common/system/tray_accessibility.h"
22 #include "ash/common/wm_shell.h" 22 #include "ash/common/wm_shell.h"
23 #include "ash/resources/vector_icons/vector_icons.h"
23 #include "base/logging.h" 24 #include "base/logging.h"
24 #include "base/strings/utf_string_conversions.h" 25 #include "base/strings/utf_string_conversions.h"
25 #include "grit/ash_resources.h" 26 #include "grit/ash_resources.h"
26 #include "grit/ash_strings.h" 27 #include "grit/ash_strings.h"
27 #include "ui/accessibility/ax_enums.h" 28 #include "ui/accessibility/ax_enums.h"
28 #include "ui/accessibility/ax_view_state.h" 29 #include "ui/accessibility/ax_view_state.h"
29 #include "ui/base/resource/resource_bundle.h" 30 #include "ui/base/resource/resource_bundle.h"
30 #include "ui/gfx/font.h" 31 #include "ui/gfx/font.h"
31 #include "ui/gfx/image/image.h" 32 #include "ui/gfx/image/image.h"
32 #include "ui/gfx/paint_vector_icon.h" 33 #include "ui/gfx/paint_vector_icon.h"
33 #include "ui/gfx/vector_icons_public.h"
34 #include "ui/keyboard/keyboard_util.h" 34 #include "ui/keyboard/keyboard_util.h"
35 #include "ui/views/controls/label.h" 35 #include "ui/views/controls/label.h"
36 #include "ui/views/layout/box_layout.h" 36 #include "ui/views/layout/box_layout.h"
37 #include "ui/views/widget/widget.h" 37 #include "ui/views/widget/widget.h"
38 38
39 namespace ash { 39 namespace ash {
40 namespace tray { 40 namespace tray {
41 41
42 // A |HoverHighlightView| that uses bold or normal font depending on whether 42 // A |HoverHighlightView| that uses bold or normal font depending on whether
43 // it is selected. This view exposes itself as a checkbox to the accessibility 43 // it is selected. This view exposes itself as a checkbox to the accessibility
(...skipping 19 matching lines...) Expand all
63 } 63 }
64 64
65 private: 65 private:
66 bool selected_; 66 bool selected_;
67 67
68 DISALLOW_COPY_AND_ASSIGN(SelectableHoverHighlightView); 68 DISALLOW_COPY_AND_ASSIGN(SelectableHoverHighlightView);
69 }; 69 };
70 70
71 class IMEDefaultView : public TrayItemMore { 71 class IMEDefaultView : public TrayItemMore {
72 public: 72 public:
73 explicit IMEDefaultView(SystemTrayItem* owner, const base::string16& label) 73 IMEDefaultView(SystemTrayItem* owner, const base::string16& label)
74 : TrayItemMore(owner, true) { 74 : TrayItemMore(owner, true) {
75 if (MaterialDesignController::IsSystemTrayMenuMaterial()) { 75 if (MaterialDesignController::IsSystemTrayMenuMaterial()) {
76 SetImage(gfx::CreateVectorIcon(gfx::VectorIconId::SYSTEM_MENU_KEYBOARD, 76 SetImage(gfx::CreateVectorIcon(kSystemMenuKeyboardIcon, kMenuIconColor));
77 kMenuIconColor));
78 } else { 77 } else {
79 ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance(); 78 ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance();
80 SetImage(*bundle.GetImageNamed(IDR_AURA_UBER_TRAY_IME).ToImageSkia()); 79 SetImage(*bundle.GetImageNamed(IDR_AURA_UBER_TRAY_IME).ToImageSkia());
81 } 80 }
82 UpdateLabel(label); 81 UpdateLabel(label);
83 } 82 }
84 83
85 ~IMEDefaultView() override {} 84 ~IMEDefaultView() override {}
86 85
87 void UpdateLabel(const base::string16& label) { 86 void UpdateLabel(const base::string16& label) {
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 else 299 else
301 Update(); 300 Update();
302 } 301 }
303 302
304 bool TrayIME::ShouldDefaultViewBeVisible() { 303 bool TrayIME::ShouldDefaultViewBeVisible() {
305 return is_visible_ && (ime_list_.size() > 1 || property_list_.size() > 1 || 304 return is_visible_ && (ime_list_.size() > 1 || property_list_.size() > 1 ||
306 ShouldShowKeyboardToggle()); 305 ShouldShowKeyboardToggle());
307 } 306 }
308 307
309 } // namespace ash 308 } // namespace ash
OLDNEW
« no previous file with comments | « ash/common/DEPS ('k') | ash/resources/vector_icons/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698