| 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/cast/tray_cast.h" | 13 #include "ash/system/cast/tray_cast.h" |
| 14 #include "ash/system/tray/system_tray_bubble.h" | 14 #include "ash/system/tray/system_tray_bubble.h" |
| 15 #include "ash/system/tray/tray_background_view.h" | 15 #include "ash/system/tray/tray_background_view.h" |
| 16 #include "ash/system/user/login_status.h" | 16 #include "ash/system/user/login_status.h" |
| 17 #include "base/compiler_specific.h" | 17 #include "base/compiler_specific.h" |
| 18 #include "base/macros.h" | 18 #include "base/macros.h" |
| 19 #include "base/memory/scoped_vector.h" | 19 #include "base/memory/scoped_vector.h" |
| 20 #include "ui/views/bubble/tray_bubble_view.h" | 20 #include "ui/views/bubble/tray_bubble_view.h" |
| 21 #include "ui/views/view.h" | 21 #include "ui/views/view.h" |
| 22 | 22 |
| 23 namespace ash { | 23 namespace ash { |
| 24 class ScreenTrayItem; | 24 class ScreenTrayItem; |
| 25 class SystemBubbleWrapper; | 25 class SystemBubbleWrapper; |
| 26 class SystemTrayDelegate; | 26 class SystemTrayDelegate; |
| 27 class SystemTrayItem; | 27 class SystemTrayItem; |
| 28 class TrayAccessibility; | 28 class TrayAccessibility; |
| 29 class TrayDate; | 29 class TrayDate; |
| 30 class TrayUpdate; |
| 30 class TrayUser; | 31 class TrayUser; |
| 31 | 32 |
| 32 // There are different methods for creating bubble views. | 33 // There are different methods for creating bubble views. |
| 33 enum BubbleCreationType { | 34 enum BubbleCreationType { |
| 34 BUBBLE_CREATE_NEW, // Closes any existing bubble and creates a new one. | 35 BUBBLE_CREATE_NEW, // Closes any existing bubble and creates a new one. |
| 35 BUBBLE_USE_EXISTING, // Uses any existing bubble, or creates a new one. | 36 BUBBLE_USE_EXISTING, // Uses any existing bubble, or creates a new one. |
| 36 }; | 37 }; |
| 37 | 38 |
| 38 class ASH_EXPORT SystemTray : public TrayBackgroundView, | 39 class ASH_EXPORT SystemTray : public TrayBackgroundView, |
| 39 public views::TrayBubbleView::Delegate { | 40 public views::TrayBubbleView::Delegate { |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 ScreenTrayItem* GetScreenShareItem() { return screen_share_tray_item_; } | 145 ScreenTrayItem* GetScreenShareItem() { return screen_share_tray_item_; } |
| 145 ScreenTrayItem* GetScreenCaptureItem() { return screen_capture_tray_item_; } | 146 ScreenTrayItem* GetScreenCaptureItem() { return screen_capture_tray_item_; } |
| 146 | 147 |
| 147 TrayAccessibility* GetTrayAccessibilityForTest() { | 148 TrayAccessibility* GetTrayAccessibilityForTest() { |
| 148 return tray_accessibility_; | 149 return tray_accessibility_; |
| 149 } | 150 } |
| 150 | 151 |
| 151 // Get the tray item view (or NULL) for a given |tray_item| in a unit test. | 152 // Get the tray item view (or NULL) for a given |tray_item| in a unit test. |
| 152 views::View* GetTrayItemViewForTest(SystemTrayItem* tray_item); | 153 views::View* GetTrayItemViewForTest(SystemTrayItem* tray_item); |
| 153 | 154 |
| 154 // Gets tray_cast_ for browser tests. | |
| 155 TrayCast* GetTrayCastForTesting() const; | 155 TrayCast* GetTrayCastForTesting() const; |
| 156 | |
| 157 // Gets tray_date_ for browser tests. | |
| 158 TrayDate* GetTrayDateForTesting() const; | 156 TrayDate* GetTrayDateForTesting() const; |
| 157 TrayUpdate* GetTrayUpdateForTesting() const; |
| 159 | 158 |
| 160 private: | 159 private: |
| 161 // Creates the default set of items for the sytem tray. | 160 // Creates the default set of items for the sytem tray. |
| 162 void CreateItems(SystemTrayDelegate* delegate); | 161 void CreateItems(SystemTrayDelegate* delegate); |
| 163 | 162 |
| 164 // Resets |system_bubble_| and clears any related state. | 163 // Resets |system_bubble_| and clears any related state. |
| 165 void DestroySystemBubble(); | 164 void DestroySystemBubble(); |
| 166 | 165 |
| 167 // Resets |notification_bubble_| and clears any related state. | 166 // Resets |notification_bubble_| and clears any related state. |
| 168 void DestroyNotificationBubble(); | 167 void DestroyNotificationBubble(); |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 bool hide_notifications_; | 234 bool hide_notifications_; |
| 236 | 235 |
| 237 // This is true when the displayed system tray menu is a full tray menu, | 236 // This is true when the displayed system tray menu is a full tray menu, |
| 238 // otherwise a single line item menu like the volume slider is shown. | 237 // otherwise a single line item menu like the volume slider is shown. |
| 239 // Note that the value is only valid when |system_bubble_| is true. | 238 // Note that the value is only valid when |system_bubble_| is true. |
| 240 bool full_system_tray_menu_; | 239 bool full_system_tray_menu_; |
| 241 | 240 |
| 242 TrayAccessibility* tray_accessibility_; // not owned | 241 TrayAccessibility* tray_accessibility_; // not owned |
| 243 TrayCast* tray_cast_; | 242 TrayCast* tray_cast_; |
| 244 TrayDate* tray_date_; | 243 TrayDate* tray_date_; |
| 244 TrayUpdate* tray_update_; |
| 245 | 245 |
| 246 // A reference to the Screen share and capture item. | 246 // A reference to the Screen share and capture item. |
| 247 ScreenTrayItem* screen_capture_tray_item_; // not owned | 247 ScreenTrayItem* screen_capture_tray_item_; // not owned |
| 248 ScreenTrayItem* screen_share_tray_item_; // not owned | 248 ScreenTrayItem* screen_share_tray_item_; // not owned |
| 249 | 249 |
| 250 DISALLOW_COPY_AND_ASSIGN(SystemTray); | 250 DISALLOW_COPY_AND_ASSIGN(SystemTray); |
| 251 }; | 251 }; |
| 252 | 252 |
| 253 } // namespace ash | 253 } // namespace ash |
| 254 | 254 |
| 255 #endif // ASH_SYSTEM_TRAY_SYSTEM_TRAY_H_ | 255 #endif // ASH_SYSTEM_TRAY_SYSTEM_TRAY_H_ |
| OLD | NEW |