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/tray_accessibility.h" | 5 #include "ash/common/system/tray_accessibility.h" |
6 | 6 |
7 #include "ash/common/accessibility_delegate.h" | 7 #include "ash/common/accessibility_delegate.h" |
8 #include "ash/common/accessibility_types.h" | 8 #include "ash/common/accessibility_types.h" |
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_delegate.h" | 13 #include "ash/common/system/tray/system_tray_delegate.h" |
14 #include "ash/common/system/tray/system_tray_notifier.h" | 14 #include "ash/common/system/tray/system_tray_notifier.h" |
15 #include "ash/common/system/tray/tray_constants.h" | 15 #include "ash/common/system/tray/tray_constants.h" |
16 #include "ash/common/system/tray/tray_details_view.h" | 16 #include "ash/common/system/tray/tray_details_view.h" |
17 #include "ash/common/system/tray/tray_item_more.h" | 17 #include "ash/common/system/tray/tray_item_more.h" |
18 #include "ash/common/system/tray/tray_popup_label_button.h" | 18 #include "ash/common/system/tray/tray_popup_label_button.h" |
19 #include "ash/common/wm_shell.h" | 19 #include "ash/common/wm_shell.h" |
| 20 #include "ash/resources/vector_icons/vector_icons.h" |
20 #include "base/strings/utf_string_conversions.h" | 21 #include "base/strings/utf_string_conversions.h" |
21 #include "grit/ash_resources.h" | 22 #include "grit/ash_resources.h" |
22 #include "grit/ash_strings.h" | 23 #include "grit/ash_strings.h" |
23 #include "ui/base/l10n/l10n_util.h" | 24 #include "ui/base/l10n/l10n_util.h" |
24 #include "ui/base/resource/resource_bundle.h" | 25 #include "ui/base/resource/resource_bundle.h" |
25 #include "ui/gfx/image/image.h" | 26 #include "ui/gfx/image/image.h" |
26 #include "ui/gfx/paint_vector_icon.h" | 27 #include "ui/gfx/paint_vector_icon.h" |
27 #include "ui/gfx/vector_icons_public.h" | |
28 #include "ui/views/controls/image_view.h" | 28 #include "ui/views/controls/image_view.h" |
29 #include "ui/views/controls/label.h" | 29 #include "ui/views/controls/label.h" |
30 #include "ui/views/layout/box_layout.h" | 30 #include "ui/views/layout/box_layout.h" |
31 #include "ui/views/widget/widget.h" | 31 #include "ui/views/widget/widget.h" |
32 | 32 |
33 namespace ash { | 33 namespace ash { |
34 namespace { | 34 namespace { |
35 | 35 |
36 enum AccessibilityState { | 36 enum AccessibilityState { |
37 A11Y_NONE = 0, | 37 A11Y_NONE = 0, |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 } // namespace | 71 } // namespace |
72 | 72 |
73 namespace tray { | 73 namespace tray { |
74 | 74 |
75 class DefaultAccessibilityView : public TrayItemMore { | 75 class DefaultAccessibilityView : public TrayItemMore { |
76 public: | 76 public: |
77 explicit DefaultAccessibilityView(SystemTrayItem* owner) | 77 explicit DefaultAccessibilityView(SystemTrayItem* owner) |
78 : TrayItemMore(owner, true) { | 78 : TrayItemMore(owner, true) { |
79 ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance(); | 79 ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance(); |
80 if (MaterialDesignController::UseMaterialDesignSystemIcons()) { | 80 if (MaterialDesignController::UseMaterialDesignSystemIcons()) { |
81 SetImage(gfx::CreateVectorIcon( | 81 SetImage( |
82 gfx::VectorIconId::SYSTEM_MENU_ACCESSIBILITY, kMenuIconColor)); | 82 gfx::CreateVectorIcon(kSystemMenuAccessibilityIcon, kMenuIconColor)); |
83 } else { | 83 } else { |
84 SetImage(*bundle.GetImageNamed(IDR_AURA_UBER_TRAY_ACCESSIBILITY_DARK) | 84 SetImage(*bundle.GetImageNamed(IDR_AURA_UBER_TRAY_ACCESSIBILITY_DARK) |
85 .ToImageSkia()); | 85 .ToImageSkia()); |
86 } | 86 } |
87 base::string16 label = | 87 base::string16 label = |
88 bundle.GetLocalizedString(IDS_ASH_STATUS_TRAY_ACCESSIBILITY); | 88 bundle.GetLocalizedString(IDS_ASH_STATUS_TRAY_ACCESSIBILITY); |
89 SetLabel(label); | 89 SetLabel(label); |
90 SetAccessibleName(label); | 90 SetAccessibleName(label); |
91 set_id(test::kAccessibilityTrayItemViewId); | 91 set_id(test::kAccessibilityTrayItemViewId); |
92 } | 92 } |
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
415 if (detailed_popup_) | 415 if (detailed_popup_) |
416 detailed_popup_->GetWidget()->Close(); | 416 detailed_popup_->GetWidget()->Close(); |
417 if (detailed_menu_) | 417 if (detailed_menu_) |
418 detailed_menu_->GetWidget()->Close(); | 418 detailed_menu_->GetWidget()->Close(); |
419 } | 419 } |
420 | 420 |
421 previous_accessibility_state_ = accessibility_state; | 421 previous_accessibility_state_ = accessibility_state; |
422 } | 422 } |
423 | 423 |
424 } // namespace ash | 424 } // namespace ash |
OLD | NEW |