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_SYSTEM_TRAY_H_ | 5 #ifndef ASH_SYSTEM_TRAY_SYSTEM_TRAY_H_ |
6 #define ASH_SYSTEM_TRAY_SYSTEM_TRAY_H_ | 6 #define ASH_SYSTEM_TRAY_SYSTEM_TRAY_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <memory> | 9 #include <memory> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "ash/ash_export.h" | 12 #include "ash/ash_export.h" |
13 #include "ash/system/tray/system_tray_bubble.h" | 13 #include "ash/system/tray/system_tray_bubble.h" |
14 #include "ash/system/tray/tray_background_view.h" | 14 #include "ash/system/tray/tray_background_view.h" |
15 #include "base/macros.h" | 15 #include "base/macros.h" |
16 #include "ui/views/bubble/tray_bubble_view.h" | 16 #include "ui/views/bubble/tray_bubble_view.h" |
17 #include "ui/views/view.h" | 17 #include "ui/views/view.h" |
18 | 18 |
19 namespace ash { | 19 namespace ash { |
20 | 20 |
21 class KeyEventWatcher; | 21 class KeyEventWatcher; |
James Cook
2017/06/09 16:06:13
Still needed?
yawano
2017/06/12 09:11:03
No, SystemTray no longer uses it. Removed.
| |
22 enum class LoginStatus; | 22 enum class LoginStatus; |
23 class ScreenTrayItem; | 23 class ScreenTrayItem; |
24 class SystemBubbleWrapper; | 24 class SystemBubbleWrapper; |
25 class SystemTrayDelegate; | 25 class SystemTrayDelegate; |
26 class SystemTrayItem; | 26 class SystemTrayItem; |
27 class TrayAccessibility; | 27 class TrayAccessibility; |
28 class TrayAudio; | 28 class TrayAudio; |
29 class TrayCast; | 29 class TrayCast; |
30 class TrayEnterprise; | 30 class TrayEnterprise; |
31 class TrayNetwork; | 31 class TrayNetwork; |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
125 void AnchorUpdated() override; | 125 void AnchorUpdated() override; |
126 base::string16 GetAccessibleNameForTray() override; | 126 base::string16 GetAccessibleNameForTray() override; |
127 void BubbleResized(const views::TrayBubbleView* bubble_view) override; | 127 void BubbleResized(const views::TrayBubbleView* bubble_view) override; |
128 void HideBubbleWithView(const views::TrayBubbleView* bubble_view) override; | 128 void HideBubbleWithView(const views::TrayBubbleView* bubble_view) override; |
129 void ClickedOutsideBubble() override; | 129 void ClickedOutsideBubble() override; |
130 | 130 |
131 // views::TrayBubbleView::Delegate: | 131 // views::TrayBubbleView::Delegate: |
132 void BubbleViewDestroyed() override; | 132 void BubbleViewDestroyed() override; |
133 void OnMouseEnteredView() override; | 133 void OnMouseEnteredView() override; |
134 void OnMouseExitedView() override; | 134 void OnMouseExitedView() override; |
135 void RegisterAccelerators(const std::vector<ui::Accelerator>& accelerators, | |
136 views::TrayBubbleView* tray_bubble_view) override; | |
137 void UnregisterAllAccelerators( | |
138 views::TrayBubbleView* tray_bubble_view) override; | |
135 base::string16 GetAccessibleNameForBubble() override; | 139 base::string16 GetAccessibleNameForBubble() override; |
140 bool ShouldEnableExtraKeyboardAccessibility() override; | |
136 void HideBubble(const views::TrayBubbleView* bubble_view) override; | 141 void HideBubble(const views::TrayBubbleView* bubble_view) override; |
137 | 142 |
138 ScreenTrayItem* GetScreenShareItem() { return screen_share_tray_item_; } | 143 ScreenTrayItem* GetScreenShareItem() { return screen_share_tray_item_; } |
139 ScreenTrayItem* GetScreenCaptureItem() { return screen_capture_tray_item_; } | 144 ScreenTrayItem* GetScreenCaptureItem() { return screen_capture_tray_item_; } |
140 | 145 |
141 TrayAccessibility* GetTrayAccessibilityForTest() { | 146 TrayAccessibility* GetTrayAccessibilityForTest() { |
142 return tray_accessibility_; | 147 return tray_accessibility_; |
143 } | 148 } |
144 | 149 |
145 // TODO(jamescook): Add a SystemTrayTestApi instead of these methods. | 150 // TODO(jamescook): Add a SystemTrayTestApi instead of these methods. |
(...skipping 11 matching lines...) Expand all Loading... | |
157 class ActivationObserver; | 162 class ActivationObserver; |
158 | 163 |
159 // Closes the bubble. Used to bind as a KeyEventWatcher::KeyEventCallback. | 164 // Closes the bubble. Used to bind as a KeyEventWatcher::KeyEventCallback. |
160 void CloseBubble(const ui::KeyEvent& key_event); | 165 void CloseBubble(const ui::KeyEvent& key_event); |
161 | 166 |
162 // Activates the bubble and starts key navigation with the |key_event|. | 167 // Activates the bubble and starts key navigation with the |key_event|. |
163 void ActivateAndStartNavigation(const ui::KeyEvent& key_event); | 168 void ActivateAndStartNavigation(const ui::KeyEvent& key_event); |
164 | 169 |
165 // Creates the key event watcher. See |ShowItems()| for why key events are | 170 // Creates the key event watcher. See |ShowItems()| for why key events are |
166 // observed. | 171 // observed. |
167 void CreateKeyEventWatcher(); | 172 void CreateKeyEventWatcher(); |
James Cook
2017/06/09 16:06:13
Didn't you delete this function?
yawano
2017/06/12 09:11:03
Yes, I've deleted the function. Thank you for catc
| |
168 | 173 |
169 // Creates the default set of items for the sytem tray. | 174 // Creates the default set of items for the sytem tray. |
170 void CreateItems(SystemTrayDelegate* delegate); | 175 void CreateItems(SystemTrayDelegate* delegate); |
171 | 176 |
172 // Resets |system_bubble_| and clears any related state. | 177 // Resets |system_bubble_| and clears any related state. |
173 void DestroySystemBubble(); | 178 void DestroySystemBubble(); |
174 | 179 |
175 // Returns a string with the current time for accessibility on the status | 180 // Returns a string with the current time for accessibility on the status |
176 // tray bar. | 181 // tray bar. |
177 base::string16 GetAccessibleTimeString(const base::Time& now) const; | 182 base::string16 GetAccessibleTimeString(const base::Time& now) const; |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
234 TrayScale* tray_scale_ = nullptr; | 239 TrayScale* tray_scale_ = nullptr; |
235 TraySupervisedUser* tray_supervised_user_ = nullptr; | 240 TraySupervisedUser* tray_supervised_user_ = nullptr; |
236 TraySystemInfo* tray_system_info_ = nullptr; | 241 TraySystemInfo* tray_system_info_ = nullptr; |
237 TrayUpdate* tray_update_ = nullptr; | 242 TrayUpdate* tray_update_ = nullptr; |
238 TrayNightLight* tray_night_light_ = nullptr; | 243 TrayNightLight* tray_night_light_ = nullptr; |
239 | 244 |
240 // A reference to the Screen share and capture item. | 245 // A reference to the Screen share and capture item. |
241 ScreenTrayItem* screen_capture_tray_item_ = nullptr; // not owned | 246 ScreenTrayItem* screen_capture_tray_item_ = nullptr; // not owned |
242 ScreenTrayItem* screen_share_tray_item_ = nullptr; // not owned | 247 ScreenTrayItem* screen_share_tray_item_ = nullptr; // not owned |
243 | 248 |
244 std::unique_ptr<KeyEventWatcher> key_event_watcher_; | |
245 | |
246 std::unique_ptr<ActivationObserver> activation_observer_; | 249 std::unique_ptr<ActivationObserver> activation_observer_; |
247 | 250 |
248 DISALLOW_COPY_AND_ASSIGN(SystemTray); | 251 DISALLOW_COPY_AND_ASSIGN(SystemTray); |
249 }; | 252 }; |
250 | 253 |
251 } // namespace ash | 254 } // namespace ash |
252 | 255 |
253 #endif // ASH_SYSTEM_TRAY_SYSTEM_TRAY_H_ | 256 #endif // ASH_SYSTEM_TRAY_SYSTEM_TRAY_H_ |
OLD | NEW |