| 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/system/accessibility_observer.h" | 11 #include "ash/system/accessibility_observer.h" |
| 12 #include "ash/system/tray/tray_details_view.h" | 12 #include "ash/system/tray/tray_details_view.h" |
| 13 #include "ash/system/tray/tray_image_item.h" | 13 #include "ash/system/tray/tray_image_item.h" |
| 14 #include "base/macros.h" | 14 #include "base/macros.h" |
| 15 #include "ui/gfx/font.h" | 15 #include "ui/gfx/font.h" |
| 16 #include "ui/views/controls/button/button.h" | 16 #include "ui/views/controls/button/button.h" |
| 17 #include "ui/views/view.h" | 17 #include "ui/views/view.h" |
| 18 | 18 |
| 19 namespace chromeos { | 19 namespace chromeos { |
| 20 class TrayAccessibilityTest; | 20 class TrayAccessibilityTest; |
| 21 } | 21 } |
| 22 | 22 |
| 23 namespace views { | 23 namespace views { |
| 24 class Button; | 24 class Button; |
| 25 class CustomButton; | 25 class CustomButton; |
| 26 class Label; | |
| 27 class View; | 26 class View; |
| 28 } | 27 } |
| 29 | 28 |
| 30 namespace ash { | 29 namespace ash { |
| 31 class SystemTrayItem; | 30 class SystemTrayItem; |
| 32 | 31 |
| 33 namespace tray { | 32 namespace tray { |
| 34 | 33 |
| 35 // A view for closable notification views, laid out like: | |
| 36 // ------------------- | |
| 37 // | icon contents x | | |
| 38 // ----------------v-- | |
| 39 // The close button will call OnClose() when clicked. | |
| 40 class AccessibilityPopupView : public views::View { | |
| 41 public: | |
| 42 explicit AccessibilityPopupView(uint32_t enabled_state_bits); | |
| 43 | |
| 44 const views::Label* label_for_test() const { return label_; } | |
| 45 | |
| 46 void Init(); | |
| 47 | |
| 48 private: | |
| 49 views::Label* CreateLabel(uint32_t enabled_state_bits); | |
| 50 | |
| 51 views::Label* label_; | |
| 52 | |
| 53 DISALLOW_COPY_AND_ASSIGN(AccessibilityPopupView); | |
| 54 }; | |
| 55 | |
| 56 // Create the detailed view of accessibility tray. | 34 // Create the detailed view of accessibility tray. |
| 57 class AccessibilityDetailedView : public TrayDetailsView { | 35 class AccessibilityDetailedView : public TrayDetailsView { |
| 58 public: | 36 public: |
| 59 explicit AccessibilityDetailedView(SystemTrayItem* owner); | 37 explicit AccessibilityDetailedView(SystemTrayItem* owner); |
| 60 ~AccessibilityDetailedView() override {} | 38 ~AccessibilityDetailedView() override {} |
| 61 | 39 |
| 62 private: | 40 private: |
| 63 // TrayDetailsView: | 41 // TrayDetailsView: |
| 64 void HandleViewClicked(views::View* view) override; | 42 void HandleViewClicked(views::View* view) override; |
| 65 void HandleButtonPressed(views::Button* sender, | 43 void HandleButtonPressed(views::Button* sender, |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 views::View* CreateDetailedView(LoginStatus status) override; | 103 views::View* CreateDetailedView(LoginStatus status) override; |
| 126 void DestroyDefaultView() override; | 104 void DestroyDefaultView() override; |
| 127 void DestroyDetailedView() override; | 105 void DestroyDetailedView() override; |
| 128 void UpdateAfterLoginStatusChange(LoginStatus status) override; | 106 void UpdateAfterLoginStatusChange(LoginStatus status) override; |
| 129 | 107 |
| 130 // Overridden from AccessibilityObserver. | 108 // Overridden from AccessibilityObserver. |
| 131 void OnAccessibilityModeChanged( | 109 void OnAccessibilityModeChanged( |
| 132 AccessibilityNotificationVisibility notify) override; | 110 AccessibilityNotificationVisibility notify) override; |
| 133 | 111 |
| 134 views::View* default_; | 112 views::View* default_; |
| 135 tray::AccessibilityPopupView* detailed_popup_; | |
| 136 tray::AccessibilityDetailedView* detailed_menu_; | 113 tray::AccessibilityDetailedView* detailed_menu_; |
| 137 | 114 |
| 138 // Bitmap of fvalues from AccessibilityState. Can contain any or | |
| 139 // both of A11Y_SPOKEN_FEEDBACK A11Y_BRAILLE_DISPLAY_CONNECTED. | |
| 140 uint32_t request_popup_view_state_; | |
| 141 | |
| 142 bool tray_icon_visible_; | 115 bool tray_icon_visible_; |
| 143 LoginStatus login_; | 116 LoginStatus login_; |
| 144 | 117 |
| 145 // Bitmap of values from AccessibilityState enum. | 118 // Bitmap of values from AccessibilityState enum. |
| 146 uint32_t previous_accessibility_state_; | 119 uint32_t previous_accessibility_state_; |
| 147 | 120 |
| 148 // A11y feature status on just entering the lock screen. | 121 // A11y feature status on just entering the lock screen. |
| 149 bool show_a11y_menu_on_lock_screen_; | 122 bool show_a11y_menu_on_lock_screen_; |
| 150 | 123 |
| 151 friend class chromeos::TrayAccessibilityTest; | 124 friend class chromeos::TrayAccessibilityTest; |
| 152 DISALLOW_COPY_AND_ASSIGN(TrayAccessibility); | 125 DISALLOW_COPY_AND_ASSIGN(TrayAccessibility); |
| 153 }; | 126 }; |
| 154 | 127 |
| 155 } // namespace ash | 128 } // namespace ash |
| 156 | 129 |
| 157 #endif // ASH_SYSTEM_TRAY_ACCESSIBILITY_H_ | 130 #endif // ASH_SYSTEM_TRAY_ACCESSIBILITY_H_ |
| OLD | NEW |