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/tray_background_view.h" | 10 #include "ash/system/tray/tray_background_view.h" |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 | 88 |
89 // Updates the items when the login status of the system changes. | 89 // Updates the items when the login status of the system changes. |
90 void UpdateAfterLoginStatusChange(user::LoginStatus login_status); | 90 void UpdateAfterLoginStatusChange(user::LoginStatus login_status); |
91 | 91 |
92 // Updates the items when the shelf alignment changes. | 92 // Updates the items when the shelf alignment changes. |
93 void UpdateAfterShelfAlignmentChange(ShelfAlignment alignment); | 93 void UpdateAfterShelfAlignmentChange(ShelfAlignment alignment); |
94 | 94 |
95 // Temporarily hides/unhides the notification bubble. | 95 // Temporarily hides/unhides the notification bubble. |
96 void SetHideNotifications(bool hidden); | 96 void SetHideNotifications(bool hidden); |
97 | 97 |
| 98 // Returns true if the system bubble is visible. |
| 99 bool IsSystemBubbleVisible() const; |
| 100 |
98 // Returns true if any bubble is visible. | 101 // Returns true if any bubble is visible. |
99 bool IsAnyBubbleVisible() const; | 102 bool IsAnyBubbleVisible() const; |
100 | 103 |
101 // Returns true if the launcher should show. | 104 // Returns true if the mouse is inside the notification bubble. |
102 bool should_show_launcher() const { | 105 bool IsMouseInNotificationBubble() const; |
103 return bubble_.get() && should_show_launcher_; | |
104 } | |
105 | 106 |
106 AccessibilityObserver* accessibility_observer() const { | 107 AccessibilityObserver* accessibility_observer() const { |
107 return accessibility_observer_; | 108 return accessibility_observer_; |
108 } | 109 } |
109 AudioObserver* audio_observer() const { | 110 AudioObserver* audio_observer() const { |
110 return audio_observer_; | 111 return audio_observer_; |
111 } | 112 } |
112 BluetoothObserver* bluetooth_observer() const { | 113 BluetoothObserver* bluetooth_observer() const { |
113 return bluetooth_observer_; | 114 return bluetooth_observer_; |
114 } | 115 } |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 int x_offset); | 186 int x_offset); |
186 | 187 |
187 // Constructs or re-constructs |notification_bubble_| and populates it with | 188 // Constructs or re-constructs |notification_bubble_| and populates it with |
188 // |notification_items_|, or destroys it if there are no notification items. | 189 // |notification_items_|, or destroys it if there are no notification items. |
189 void UpdateNotificationBubble(); | 190 void UpdateNotificationBubble(); |
190 | 191 |
191 // Overridden from internal::ActionableView. | 192 // Overridden from internal::ActionableView. |
192 virtual bool PerformAction(const ui::Event& event) OVERRIDE; | 193 virtual bool PerformAction(const ui::Event& event) OVERRIDE; |
193 | 194 |
194 // Overridden from views::View. | 195 // Overridden from views::View. |
195 virtual void OnMouseEntered(const ui::MouseEvent& event) OVERRIDE; | |
196 virtual void OnMouseExited(const ui::MouseEvent& event) OVERRIDE; | |
197 virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE; | 196 virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE; |
198 | 197 |
199 // Owned items. | 198 // Owned items. |
200 ScopedVector<SystemTrayItem> items_; | 199 ScopedVector<SystemTrayItem> items_; |
201 | 200 |
202 // Pointers to members of |items_|. | 201 // Pointers to members of |items_|. |
203 SystemTrayItem* detailed_item_; | 202 SystemTrayItem* detailed_item_; |
204 std::vector<SystemTrayItem*> notification_items_; | 203 std::vector<SystemTrayItem*> notification_items_; |
205 | 204 |
206 // Mappings of system tray item and it's view in the tray. | 205 // Mappings of system tray item and it's view in the tray. |
(...skipping 14 matching lines...) Expand all Loading... |
221 SmsObserver* sms_observer_; | 220 SmsObserver* sms_observer_; |
222 UpdateObserver* update_observer_; | 221 UpdateObserver* update_observer_; |
223 UserObserver* user_observer_; | 222 UserObserver* user_observer_; |
224 | 223 |
225 // Bubble for default and detailed views. | 224 // Bubble for default and detailed views. |
226 scoped_ptr<internal::SystemTrayBubble> bubble_; | 225 scoped_ptr<internal::SystemTrayBubble> bubble_; |
227 | 226 |
228 // Bubble for notifications. | 227 // Bubble for notifications. |
229 scoped_ptr<internal::SystemTrayBubble> notification_bubble_; | 228 scoped_ptr<internal::SystemTrayBubble> notification_bubble_; |
230 | 229 |
231 // See description agove getter. | |
232 bool should_show_launcher_; | |
233 | |
234 // Keep track of the default view height so that when we create detailed | 230 // Keep track of the default view height so that when we create detailed |
235 // views directly (e.g. from a notification) we know what height to use. | 231 // views directly (e.g. from a notification) we know what height to use. |
236 int default_bubble_height_; | 232 int default_bubble_height_; |
237 | 233 |
238 // Set to true when system notifications should be hidden (e.g. web | 234 // Set to true when system notifications should be hidden (e.g. web |
239 // notification bubble is visible). | 235 // notification bubble is visible). |
240 bool hide_notifications_; | 236 bool hide_notifications_; |
241 | 237 |
242 DISALLOW_COPY_AND_ASSIGN(SystemTray); | 238 DISALLOW_COPY_AND_ASSIGN(SystemTray); |
243 }; | 239 }; |
244 | 240 |
245 } // namespace ash | 241 } // namespace ash |
246 | 242 |
247 #endif // ASH_SYSTEM_TRAY_SYSTEM_TRAY_H_ | 243 #endif // ASH_SYSTEM_TRAY_SYSTEM_TRAY_H_ |
OLD | NEW |