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 "ash/ash_export.h" | 8 #include "ash/ash_export.h" |
9 #include "ash/system/power/power_supply_status.h" | 9 #include "ash/system/power/power_supply_status.h" |
10 #include "ash/system/tray/system_tray_bubble.h" | 10 #include "ash/system/tray/system_tray_bubble.h" |
11 #include "ash/system/tray/tray_background_view.h" | 11 #include "ash/system/tray/tray_background_view.h" |
12 #include "ash/system/tray/tray_bubble_view.h" | |
13 #include "ash/system/tray/tray_views.h" | 12 #include "ash/system/tray/tray_views.h" |
14 #include "ash/system/user/login_status.h" | 13 #include "ash/system/user/login_status.h" |
15 #include "base/basictypes.h" | 14 #include "base/basictypes.h" |
16 #include "base/compiler_specific.h" | 15 #include "base/compiler_specific.h" |
17 #include "base/memory/scoped_ptr.h" | 16 #include "base/memory/scoped_ptr.h" |
18 #include "base/memory/scoped_vector.h" | 17 #include "base/memory/scoped_vector.h" |
| 18 #include "ui/views/bubble/tray_bubble_view.h" |
19 #include "ui/views/view.h" | 19 #include "ui/views/view.h" |
20 | 20 |
21 #include <map> | 21 #include <map> |
22 #include <vector> | 22 #include <vector> |
23 | 23 |
24 namespace ash { | 24 namespace ash { |
25 | 25 |
26 class AccessibilityObserver; | 26 class AccessibilityObserver; |
27 class AudioObserver; | 27 class AudioObserver; |
28 class BluetoothObserver; | 28 class BluetoothObserver; |
(...skipping 19 matching lines...) Expand all Loading... |
48 class TrayGestureHandler; | 48 class TrayGestureHandler; |
49 } | 49 } |
50 | 50 |
51 // There are different methods for creating bubble views. | 51 // There are different methods for creating bubble views. |
52 enum BubbleCreationType { | 52 enum BubbleCreationType { |
53 BUBBLE_CREATE_NEW, // Closes any existing bubble and creates a new one. | 53 BUBBLE_CREATE_NEW, // Closes any existing bubble and creates a new one. |
54 BUBBLE_USE_EXISTING, // Uses any existing bubble, or creates a new one. | 54 BUBBLE_USE_EXISTING, // Uses any existing bubble, or creates a new one. |
55 }; | 55 }; |
56 | 56 |
57 class ASH_EXPORT SystemTray : public internal::TrayBackgroundView, | 57 class ASH_EXPORT SystemTray : public internal::TrayBackgroundView, |
58 public message_center::TrayBubbleView::Delegate { | 58 public views::TrayBubbleView::Delegate { |
59 public: | 59 public: |
60 explicit SystemTray(internal::StatusAreaWidget* status_area_widget); | 60 explicit SystemTray(internal::StatusAreaWidget* status_area_widget); |
61 virtual ~SystemTray(); | 61 virtual ~SystemTray(); |
62 | 62 |
63 // Creates the default set of items for the sytem tray. | 63 // Creates the default set of items for the sytem tray. |
64 void CreateItems(); | 64 void CreateItems(); |
65 | 65 |
66 // Adds a new item in the tray. | 66 // Adds a new item in the tray. |
67 void AddTrayItem(SystemTrayItem* item); | 67 void AddTrayItem(SystemTrayItem* item); |
68 | 68 |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 | 169 |
170 // Returns true if the bubble exists. | 170 // Returns true if the bubble exists. |
171 bool CloseBubbleForTest() const; | 171 bool CloseBubbleForTest() const; |
172 | 172 |
173 // Overridden from TrayBackgroundView. | 173 // Overridden from TrayBackgroundView. |
174 virtual void Initialize() OVERRIDE; | 174 virtual void Initialize() OVERRIDE; |
175 virtual void SetShelfAlignment(ShelfAlignment alignment) OVERRIDE; | 175 virtual void SetShelfAlignment(ShelfAlignment alignment) OVERRIDE; |
176 virtual void AnchorUpdated() OVERRIDE; | 176 virtual void AnchorUpdated() OVERRIDE; |
177 virtual string16 GetAccessibleNameForTray() OVERRIDE; | 177 virtual string16 GetAccessibleNameForTray() OVERRIDE; |
178 virtual void HideBubbleWithView( | 178 virtual void HideBubbleWithView( |
179 const message_center::TrayBubbleView* bubble_view) OVERRIDE; | 179 const views::TrayBubbleView* bubble_view) OVERRIDE; |
180 virtual bool ClickedOutsideBubble() OVERRIDE; | 180 virtual bool ClickedOutsideBubble() OVERRIDE; |
181 | 181 |
182 // Overridden from message_center::TrayBubbleView::Delegate. | 182 // Overridden from message_center::TrayBubbleView::Delegate. |
183 virtual void BubbleViewDestroyed() OVERRIDE; | 183 virtual void BubbleViewDestroyed() OVERRIDE; |
184 virtual void OnMouseEnteredView() OVERRIDE; | 184 virtual void OnMouseEnteredView() OVERRIDE; |
185 virtual void OnMouseExitedView() OVERRIDE; | 185 virtual void OnMouseExitedView() OVERRIDE; |
186 virtual string16 GetAccessibleNameForBubble() OVERRIDE; | 186 virtual string16 GetAccessibleNameForBubble() OVERRIDE; |
187 virtual gfx::Rect GetAnchorRect(views::Widget* anchor_widget, | 187 virtual gfx::Rect GetAnchorRect(views::Widget* anchor_widget, |
188 AnchorType anchor_type, | 188 AnchorType anchor_type, |
189 AnchorAlignment anchor_alignment) OVERRIDE; | 189 AnchorAlignment anchor_alignment) OVERRIDE; |
190 virtual void HideBubble( | 190 virtual void HideBubble(const views::TrayBubbleView* bubble_view) OVERRIDE; |
191 const message_center::TrayBubbleView* bubble_view) OVERRIDE; | |
192 | 191 |
193 private: | 192 private: |
194 // Returns true if the system_bubble_ exists and is of type |type|. | 193 // Returns true if the system_bubble_ exists and is of type |type|. |
195 bool HasSystemBubbleType(internal::SystemTrayBubble::BubbleType type); | 194 bool HasSystemBubbleType(internal::SystemTrayBubble::BubbleType type); |
196 | 195 |
197 // Resets |system_bubble_| and clears any related state. | 196 // Resets |system_bubble_| and clears any related state. |
198 void DestroySystemBubble(); | 197 void DestroySystemBubble(); |
199 | 198 |
200 // Resets |notification_bubble_| and clears any related state. | 199 // Resets |notification_bubble_| and clears any related state. |
201 void DestroyNotificationBubble(); | 200 void DestroyNotificationBubble(); |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
266 // Set to true when system notifications should be hidden (e.g. web | 265 // Set to true when system notifications should be hidden (e.g. web |
267 // notification bubble is visible). | 266 // notification bubble is visible). |
268 bool hide_notifications_; | 267 bool hide_notifications_; |
269 | 268 |
270 DISALLOW_COPY_AND_ASSIGN(SystemTray); | 269 DISALLOW_COPY_AND_ASSIGN(SystemTray); |
271 }; | 270 }; |
272 | 271 |
273 } // namespace ash | 272 } // namespace ash |
274 | 273 |
275 #endif // ASH_SYSTEM_TRAY_SYSTEM_TRAY_H_ | 274 #endif // ASH_SYSTEM_TRAY_SYSTEM_TRAY_H_ |
OLD | NEW |