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 #ifndef ASH_SYSTEM_TRAY_ACCESSIBILITY_H_ | 5 #ifndef ASH_SYSTEM_TRAY_ACCESSIBILITY_H_ |
6 #define ASH_SYSTEM_TRAY_ACCESSIBILITY_H_ | 6 #define ASH_SYSTEM_TRAY_ACCESSIBILITY_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include "ash/accessibility_delegate.h" | 10 #include "ash/accessibility_delegate.h" |
11 #include "ash/shell_observer.h" | |
12 #include "ash/system/accessibility_observer.h" | 11 #include "ash/system/accessibility_observer.h" |
13 #include "ash/system/tray/tray_details_view.h" | 12 #include "ash/system/tray/tray_details_view.h" |
14 #include "ash/system/tray/tray_image_item.h" | 13 #include "ash/system/tray/tray_image_item.h" |
15 #include "base/macros.h" | 14 #include "base/macros.h" |
16 #include "ui/gfx/font.h" | 15 #include "ui/gfx/font.h" |
17 #include "ui/views/controls/button/button.h" | 16 #include "ui/views/controls/button/button.h" |
18 #include "ui/views/view.h" | 17 #include "ui/views/view.h" |
19 | 18 |
20 namespace chromeos { | 19 namespace chromeos { |
21 class TrayAccessibilityTest; | 20 class TrayAccessibilityTest; |
22 } | 21 } |
23 | 22 |
24 namespace gfx { | |
25 struct VectorIcon; | |
26 } | |
27 | |
28 namespace views { | 23 namespace views { |
29 class Button; | 24 class Button; |
30 class CustomButton; | 25 class CustomButton; |
31 class Label; | 26 class Label; |
32 class View; | 27 class View; |
33 } | 28 } |
34 | 29 |
35 namespace ash { | 30 namespace ash { |
36 class HoverHighlightView; | |
37 class SystemTrayItem; | 31 class SystemTrayItem; |
38 | 32 |
39 namespace tray { | 33 namespace tray { |
40 | 34 |
41 // A view for closable notification views, laid out like: | 35 // A view for closable notification views, laid out like: |
42 // ------------------- | 36 // ------------------- |
43 // | icon contents x | | 37 // | icon contents x | |
44 // ----------------v-- | 38 // ----------------v-- |
45 // The close button will call OnClose() when clicked. | 39 // The close button will call OnClose() when clicked. |
46 class AccessibilityPopupView : public views::View { | 40 class AccessibilityPopupView : public views::View { |
47 public: | 41 public: |
48 explicit AccessibilityPopupView(uint32_t enabled_state_bits); | 42 explicit AccessibilityPopupView(uint32_t enabled_state_bits); |
49 | 43 |
50 const views::Label* label_for_test() const { return label_; } | 44 const views::Label* label_for_test() const { return label_; } |
51 | 45 |
52 void Init(); | 46 void Init(); |
53 | 47 |
54 private: | 48 private: |
55 views::Label* CreateLabel(uint32_t enabled_state_bits); | 49 views::Label* CreateLabel(uint32_t enabled_state_bits); |
56 | 50 |
57 views::Label* label_; | 51 views::Label* label_; |
58 | 52 |
59 DISALLOW_COPY_AND_ASSIGN(AccessibilityPopupView); | 53 DISALLOW_COPY_AND_ASSIGN(AccessibilityPopupView); |
60 }; | 54 }; |
61 | 55 |
62 // Create the detailed view of accessibility tray. | 56 // Create the detailed view of accessibility tray. |
63 class AccessibilityDetailedView : public TrayDetailsView, | 57 class AccessibilityDetailedView : public TrayDetailsView { |
64 public ShellObserver { | |
tdanderson
2017/04/24 15:43:39
nice catch
| |
65 public: | 58 public: |
66 explicit AccessibilityDetailedView(SystemTrayItem* owner); | 59 explicit AccessibilityDetailedView(SystemTrayItem* owner); |
67 ~AccessibilityDetailedView() override {} | 60 ~AccessibilityDetailedView() override {} |
68 | 61 |
69 private: | 62 private: |
70 // TrayDetailsView: | 63 // TrayDetailsView: |
71 void HandleViewClicked(views::View* view) override; | 64 void HandleViewClicked(views::View* view) override; |
72 void HandleButtonPressed(views::Button* sender, | 65 void HandleButtonPressed(views::Button* sender, |
73 const ui::Event& event) override; | 66 const ui::Event& event) override; |
74 void CreateExtraTitleRowButtons() override; | 67 void CreateExtraTitleRowButtons() override; |
75 | 68 |
76 // Launches the WebUI settings in a browser and closes the system menu. | 69 // Launches the WebUI settings in a browser and closes the system menu. |
77 void ShowSettings(); | 70 void ShowSettings(); |
78 | 71 |
79 // Launches the a11y help article in a browser and closes the system menu. | 72 // Launches the a11y help article in a browser and closes the system menu. |
80 void ShowHelp(); | 73 void ShowHelp(); |
81 | 74 |
82 // Add the accessibility feature list. | 75 // Add the accessibility feature list. |
83 void AppendAccessibilityList(); | 76 void AppendAccessibilityList(); |
84 | 77 |
85 // Helper function to create entries in the detailed accessibility view. | |
86 HoverHighlightView* AddScrollListItem(const base::string16& text, | |
87 bool checked, | |
88 const gfx::VectorIcon& icon); | |
89 HoverHighlightView* AddScrollListItemWithoutIcon(const base::string16& text, | |
90 bool checked); | |
91 | |
92 void AddSubHeader(const base::string16& header_text); | |
93 | |
94 views::View* spoken_feedback_view_ = nullptr; | 78 views::View* spoken_feedback_view_ = nullptr; |
95 views::View* high_contrast_view_ = nullptr; | 79 views::View* high_contrast_view_ = nullptr; |
96 views::View* screen_magnifier_view_ = nullptr; | 80 views::View* screen_magnifier_view_ = nullptr; |
97 views::View* large_cursor_view_ = nullptr; | 81 views::View* large_cursor_view_ = nullptr; |
98 views::CustomButton* help_view_ = nullptr; | 82 views::CustomButton* help_view_ = nullptr; |
99 views::CustomButton* settings_view_ = nullptr; | 83 views::CustomButton* settings_view_ = nullptr; |
100 views::View* autoclick_view_ = nullptr; | 84 views::View* autoclick_view_ = nullptr; |
101 views::View* virtual_keyboard_view_ = nullptr; | 85 views::View* virtual_keyboard_view_ = nullptr; |
102 views::View* mono_audio_view_ = nullptr; | 86 views::View* mono_audio_view_ = nullptr; |
103 views::View* caret_highlight_view_ = nullptr; | 87 views::View* caret_highlight_view_ = nullptr; |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
164 // A11y feature status on just entering the lock screen. | 148 // A11y feature status on just entering the lock screen. |
165 bool show_a11y_menu_on_lock_screen_; | 149 bool show_a11y_menu_on_lock_screen_; |
166 | 150 |
167 friend class chromeos::TrayAccessibilityTest; | 151 friend class chromeos::TrayAccessibilityTest; |
168 DISALLOW_COPY_AND_ASSIGN(TrayAccessibility); | 152 DISALLOW_COPY_AND_ASSIGN(TrayAccessibility); |
169 }; | 153 }; |
170 | 154 |
171 } // namespace ash | 155 } // namespace ash |
172 | 156 |
173 #endif // ASH_SYSTEM_TRAY_ACCESSIBILITY_H_ | 157 #endif // ASH_SYSTEM_TRAY_ACCESSIBILITY_H_ |
OLD | NEW |