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_COMMON_SYSTEM_TRAY_SYSTEM_TRAY_H_ | 5 #ifndef ASH_COMMON_SYSTEM_TRAY_SYSTEM_TRAY_H_ |
6 #define ASH_COMMON_SYSTEM_TRAY_SYSTEM_TRAY_H_ | 6 #define ASH_COMMON_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/common/system/tray/system_tray_bubble.h" | 13 #include "ash/common/system/tray/system_tray_bubble.h" |
14 #include "ash/common/system/tray/tray_background_view.h" | 14 #include "ash/common/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; |
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 TrayDate; | |
31 class TrayNetwork; | 30 class TrayNetwork; |
32 class TraySystemInfo; | 31 class TraySystemInfo; |
33 class TrayTiles; | 32 class TrayTiles; |
34 class TrayUpdate; | 33 class TrayUpdate; |
35 class WebNotificationTray; | 34 class WebNotificationTray; |
36 | 35 |
37 // There are different methods for creating bubble views. | 36 // There are different methods for creating bubble views. |
38 enum BubbleCreationType { | 37 enum BubbleCreationType { |
39 BUBBLE_CREATE_NEW, // Closes any existing bubble and creates a new one. | 38 BUBBLE_CREATE_NEW, // Closes any existing bubble and creates a new one. |
40 BUBBLE_USE_EXISTING, // Uses any existing bubble, or creates a new one. | 39 BUBBLE_USE_EXISTING, // Uses any existing bubble, or creates a new one. |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 ScreenTrayItem* GetScreenCaptureItem() { return screen_capture_tray_item_; } | 137 ScreenTrayItem* GetScreenCaptureItem() { return screen_capture_tray_item_; } |
139 | 138 |
140 TrayAccessibility* GetTrayAccessibilityForTest() { | 139 TrayAccessibility* GetTrayAccessibilityForTest() { |
141 return tray_accessibility_; | 140 return tray_accessibility_; |
142 } | 141 } |
143 | 142 |
144 // Get the tray item view (or NULL) for a given |tray_item| in a unit test. | 143 // Get the tray item view (or NULL) for a given |tray_item| in a unit test. |
145 views::View* GetTrayItemViewForTest(SystemTrayItem* tray_item); | 144 views::View* GetTrayItemViewForTest(SystemTrayItem* tray_item); |
146 | 145 |
147 TrayCast* GetTrayCastForTesting() const; | 146 TrayCast* GetTrayCastForTesting() const; |
148 TrayDate* GetTrayDateForTesting() const; | |
149 TrayNetwork* GetTrayNetworkForTesting() const; | 147 TrayNetwork* GetTrayNetworkForTesting() const; |
150 TraySystemInfo* GetTraySystemInfoForTesting() const; | 148 TraySystemInfo* GetTraySystemInfoForTesting() const; |
151 TrayTiles* GetTrayTilesForTesting() const; | 149 TrayTiles* GetTrayTilesForTesting() const; |
152 | 150 |
153 // Activates the system tray bubble. | 151 // Activates the system tray bubble. |
154 void ActivateBubble(); | 152 void ActivateBubble(); |
155 | 153 |
156 private: | 154 private: |
157 class ActivationObserver; | 155 class ActivationObserver; |
158 | 156 |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 | 222 |
225 // This is true when the displayed system tray menu is a full tray menu, | 223 // This is true when the displayed system tray menu is a full tray menu, |
226 // otherwise a single line item menu like the volume slider is shown. | 224 // otherwise a single line item menu like the volume slider is shown. |
227 // Note that the value is only valid when |system_bubble_| is true. | 225 // Note that the value is only valid when |system_bubble_| is true. |
228 bool full_system_tray_menu_; | 226 bool full_system_tray_menu_; |
229 | 227 |
230 // These objects are not owned by this class. | 228 // These objects are not owned by this class. |
231 TrayAccessibility* tray_accessibility_; | 229 TrayAccessibility* tray_accessibility_; |
232 TrayAudio* tray_audio_; // May be null. | 230 TrayAudio* tray_audio_; // May be null. |
233 TrayCast* tray_cast_; | 231 TrayCast* tray_cast_; |
234 TrayDate* tray_date_; // null for material design. | |
235 TrayNetwork* tray_network_; | 232 TrayNetwork* tray_network_; |
236 TrayTiles* tray_tiles_; // only used in material design. | 233 TrayTiles* tray_tiles_; // only used in material design. |
237 TraySystemInfo* tray_system_info_; // only used in material design. | 234 TraySystemInfo* tray_system_info_; // only used in material design. |
238 TrayUpdate* tray_update_; | 235 TrayUpdate* tray_update_; |
239 | 236 |
240 // A reference to the Screen share and capture item. | 237 // A reference to the Screen share and capture item. |
241 ScreenTrayItem* screen_capture_tray_item_; // not owned | 238 ScreenTrayItem* screen_capture_tray_item_; // not owned |
242 ScreenTrayItem* screen_share_tray_item_; // not owned | 239 ScreenTrayItem* screen_share_tray_item_; // not owned |
243 | 240 |
244 // TODO(oshima): Remove this when crbug.com/651242 is fixed. | 241 // TODO(oshima): Remove this when crbug.com/651242 is fixed. |
245 bool activating_ = false; | 242 bool activating_ = false; |
246 | 243 |
247 std::unique_ptr<KeyEventWatcher> key_event_watcher_; | 244 std::unique_ptr<KeyEventWatcher> key_event_watcher_; |
248 | 245 |
249 std::unique_ptr<ActivationObserver> activation_observer_; | 246 std::unique_ptr<ActivationObserver> activation_observer_; |
250 | 247 |
251 DISALLOW_COPY_AND_ASSIGN(SystemTray); | 248 DISALLOW_COPY_AND_ASSIGN(SystemTray); |
252 }; | 249 }; |
253 | 250 |
254 } // namespace ash | 251 } // namespace ash |
255 | 252 |
256 #endif // ASH_COMMON_SYSTEM_TRAY_SYSTEM_TRAY_H_ | 253 #endif // ASH_COMMON_SYSTEM_TRAY_SYSTEM_TRAY_H_ |
OLD | NEW |