| 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; |
| 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 TrayNetwork; | 31 class TrayNetwork; |
| 31 class TraySupervisedUser; | 32 class TraySupervisedUser; |
| 32 class TraySystemInfo; | 33 class TraySystemInfo; |
| 33 class TrayTiles; | 34 class TrayTiles; |
| 34 class TrayUpdate; | 35 class TrayUpdate; |
| 35 class WebNotificationTray; | 36 class WebNotificationTray; |
| 36 | 37 |
| 37 // There are different methods for creating bubble views. | 38 // There are different methods for creating bubble views. |
| 38 enum BubbleCreationType { | 39 enum BubbleCreationType { |
| 39 BUBBLE_CREATE_NEW, // Closes any existing bubble and creates a new one. | 40 BUBBLE_CREATE_NEW, // Closes any existing bubble and creates a new one. |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 views::Widget::InitParams* params) const override; | 135 views::Widget::InitParams* params) const override; |
| 135 void HideBubble(const views::TrayBubbleView* bubble_view) override; | 136 void HideBubble(const views::TrayBubbleView* bubble_view) override; |
| 136 | 137 |
| 137 ScreenTrayItem* GetScreenShareItem() { return screen_share_tray_item_; } | 138 ScreenTrayItem* GetScreenShareItem() { return screen_share_tray_item_; } |
| 138 ScreenTrayItem* GetScreenCaptureItem() { return screen_capture_tray_item_; } | 139 ScreenTrayItem* GetScreenCaptureItem() { return screen_capture_tray_item_; } |
| 139 | 140 |
| 140 TrayAccessibility* GetTrayAccessibilityForTest() { | 141 TrayAccessibility* GetTrayAccessibilityForTest() { |
| 141 return tray_accessibility_; | 142 return tray_accessibility_; |
| 142 } | 143 } |
| 143 | 144 |
| 145 // TODO(jamescook): Add a SystemTrayTestApi instead of these methods. |
| 144 TrayCast* GetTrayCastForTesting() const; | 146 TrayCast* GetTrayCastForTesting() const; |
| 147 TrayEnterprise* GetTrayEnterpriseForTesting() const; |
| 145 TrayNetwork* GetTrayNetworkForTesting() const; | 148 TrayNetwork* GetTrayNetworkForTesting() const; |
| 146 TraySupervisedUser* GetTraySupervisedUserForTesting() const; | 149 TraySupervisedUser* GetTraySupervisedUserForTesting() const; |
| 147 TraySystemInfo* GetTraySystemInfoForTesting() const; | 150 TraySystemInfo* GetTraySystemInfoForTesting() const; |
| 148 TrayTiles* GetTrayTilesForTesting() const; | 151 TrayTiles* GetTrayTilesForTesting() const; |
| 149 | 152 |
| 150 // Activates the system tray bubble. | 153 // Activates the system tray bubble. |
| 151 void ActivateBubble(); | 154 void ActivateBubble(); |
| 152 | 155 |
| 153 private: | 156 private: |
| 154 class ActivationObserver; | 157 class ActivationObserver; |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 // views directly (e.g. from a notification) we know what height to use. | 219 // views directly (e.g. from a notification) we know what height to use. |
| 217 int default_bubble_height_ = 0; | 220 int default_bubble_height_ = 0; |
| 218 | 221 |
| 219 // This is true when the displayed system tray menu is a full tray menu, | 222 // This is true when the displayed system tray menu is a full tray menu, |
| 220 // otherwise a single line item menu like the volume slider is shown. | 223 // otherwise a single line item menu like the volume slider is shown. |
| 221 // Note that the value is only valid when |system_bubble_| is true. | 224 // Note that the value is only valid when |system_bubble_| is true. |
| 222 bool full_system_tray_menu_ = false; | 225 bool full_system_tray_menu_ = false; |
| 223 | 226 |
| 224 // These objects are not owned by this class. | 227 // These objects are not owned by this class. |
| 225 TrayAccessibility* tray_accessibility_ = nullptr; | 228 TrayAccessibility* tray_accessibility_ = nullptr; |
| 226 TrayAudio* tray_audio_ = nullptr; // May be null. | 229 TrayAudio* tray_audio_ = nullptr; |
| 227 TrayCast* tray_cast_ = nullptr; | 230 TrayCast* tray_cast_ = nullptr; |
| 231 TrayEnterprise* tray_enterprise_ = nullptr; |
| 228 TrayNetwork* tray_network_ = nullptr; | 232 TrayNetwork* tray_network_ = nullptr; |
| 229 TrayTiles* tray_tiles_ = nullptr; | 233 TrayTiles* tray_tiles_ = nullptr; |
| 230 TraySupervisedUser* tray_supervised_user_ = nullptr; | 234 TraySupervisedUser* tray_supervised_user_ = nullptr; |
| 231 TraySystemInfo* tray_system_info_ = nullptr; | 235 TraySystemInfo* tray_system_info_ = nullptr; |
| 232 TrayUpdate* tray_update_ = nullptr; | 236 TrayUpdate* tray_update_ = nullptr; |
| 233 | 237 |
| 234 // A reference to the Screen share and capture item. | 238 // A reference to the Screen share and capture item. |
| 235 ScreenTrayItem* screen_capture_tray_item_ = nullptr; // not owned | 239 ScreenTrayItem* screen_capture_tray_item_ = nullptr; // not owned |
| 236 ScreenTrayItem* screen_share_tray_item_ = nullptr; // not owned | 240 ScreenTrayItem* screen_share_tray_item_ = nullptr; // not owned |
| 237 | 241 |
| 238 std::unique_ptr<KeyEventWatcher> key_event_watcher_; | 242 std::unique_ptr<KeyEventWatcher> key_event_watcher_; |
| 239 | 243 |
| 240 std::unique_ptr<ActivationObserver> activation_observer_; | 244 std::unique_ptr<ActivationObserver> activation_observer_; |
| 241 | 245 |
| 242 DISALLOW_COPY_AND_ASSIGN(SystemTray); | 246 DISALLOW_COPY_AND_ASSIGN(SystemTray); |
| 243 }; | 247 }; |
| 244 | 248 |
| 245 } // namespace ash | 249 } // namespace ash |
| 246 | 250 |
| 247 #endif // ASH_SYSTEM_TRAY_SYSTEM_TRAY_H_ | 251 #endif // ASH_SYSTEM_TRAY_SYSTEM_TRAY_H_ |
| OLD | NEW |