Chromium Code Reviews| OLD | NEW |
|---|---|
| 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/resources/vector_icons.h" | |
| 10 #include "ash/common/session/session_state_delegate.h" | 11 #include "ash/common/session/session_state_delegate.h" |
| 11 #include "ash/common/system/chromeos/ime_menu/ime_list_view.h" | 12 #include "ash/common/system/chromeos/ime_menu/ime_list_view.h" |
| 12 #include "ash/common/system/tray/hover_highlight_view.h" | 13 #include "ash/common/system/tray/hover_highlight_view.h" |
| 13 #include "ash/common/system/tray/system_tray.h" | 14 #include "ash/common/system/tray/system_tray.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_utils.h" | 21 #include "ash/common/system/tray/tray_utils.h" |
| 21 #include "ash/common/system/tray_accessibility.h" | 22 #include "ash/common/system/tray_accessibility.h" |
| 22 #include "ash/common/wm_shell.h" | 23 #include "ash/common/wm_shell.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 Loading... | |
| 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( |
| 77 kMenuIconColor)); | 77 gfx::CreateVectorIcon(ash::kSystemMenuKeyboardIcon, kMenuIconColor)); |
|
James Cook
2016/08/30 22:10:12
nit: ash:: not needed
tdanderson
2016/08/31 22:18:20
Done.
| |
| 78 } else { | 78 } else { |
| 79 ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance(); | 79 ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance(); |
| 80 SetImage(*bundle.GetImageNamed(IDR_AURA_UBER_TRAY_IME).ToImageSkia()); | 80 SetImage(*bundle.GetImageNamed(IDR_AURA_UBER_TRAY_IME).ToImageSkia()); |
| 81 } | 81 } |
| 82 UpdateLabel(label); | 82 UpdateLabel(label); |
| 83 } | 83 } |
| 84 | 84 |
| 85 ~IMEDefaultView() override {} | 85 ~IMEDefaultView() override {} |
| 86 | 86 |
| 87 void UpdateLabel(const base::string16& label) { | 87 void UpdateLabel(const base::string16& label) { |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 300 else | 300 else |
| 301 Update(); | 301 Update(); |
| 302 } | 302 } |
| 303 | 303 |
| 304 bool TrayIME::ShouldDefaultViewBeVisible() { | 304 bool TrayIME::ShouldDefaultViewBeVisible() { |
| 305 return is_visible_ && (ime_list_.size() > 1 || property_list_.size() > 1 || | 305 return is_visible_ && (ime_list_.size() > 1 || property_list_.size() > 1 || |
| 306 ShouldShowKeyboardToggle()); | 306 ShouldShowKeyboardToggle()); |
| 307 } | 307 } |
| 308 | 308 |
| 309 } // namespace ash | 309 } // namespace ash |
| OLD | NEW |