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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "ash/ash_export.h" | 9 #include "ash/ash_export.h" |
10 #include "ash/system/power/power_supply_status.h" | |
10 #include "ash/system/tray/tray_background_view.h" | 11 #include "ash/system/tray/tray_background_view.h" |
11 #include "ash/system/tray/tray_views.h" | 12 #include "ash/system/tray/tray_views.h" |
12 #include "ash/system/user/login_status.h" | 13 #include "ash/system/user/login_status.h" |
13 #include "ash/wm/shelf_auto_hide_behavior.h" | 14 #include "ash/wm/shelf_auto_hide_behavior.h" |
14 #include "base/basictypes.h" | 15 #include "base/basictypes.h" |
15 #include "base/compiler_specific.h" | 16 #include "base/compiler_specific.h" |
16 #include "base/memory/scoped_ptr.h" | 17 #include "base/memory/scoped_ptr.h" |
17 #include "base/memory/scoped_vector.h" | 18 #include "base/memory/scoped_vector.h" |
18 #include "ui/views/view.h" | 19 #include "ui/views/view.h" |
19 | 20 |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
89 | 90 |
90 // Hides the notification view for |item|. | 91 // Hides the notification view for |item|. |
91 void HideNotificationView(SystemTrayItem* item); | 92 void HideNotificationView(SystemTrayItem* item); |
92 | 93 |
93 // Updates the items when the login status of the system changes. | 94 // Updates the items when the login status of the system changes. |
94 void UpdateAfterLoginStatusChange(user::LoginStatus login_status); | 95 void UpdateAfterLoginStatusChange(user::LoginStatus login_status); |
95 | 96 |
96 // Updates the items when the shelf alignment changes. | 97 // Updates the items when the shelf alignment changes. |
97 void UpdateAfterShelfAlignmentChange(ShelfAlignment alignment); | 98 void UpdateAfterShelfAlignmentChange(ShelfAlignment alignment); |
98 | 99 |
100 void NotifyPowerStatusChange(const PowerSupplyStatus& power_status); | |
101 | |
99 // Returns true if the launcher should show. | 102 // Returns true if the launcher should show. |
100 bool should_show_launcher() const { | 103 bool should_show_launcher() const { |
101 return bubble_.get() && should_show_launcher_; | 104 return bubble_.get() && should_show_launcher_; |
102 } | 105 } |
103 | 106 |
104 AccessibilityObserver* accessibility_observer() const { | 107 AccessibilityObserver* accessibility_observer() const { |
105 return accessibility_observer_; | 108 return accessibility_observer_; |
106 } | 109 } |
107 AudioObserver* audio_observer() const { | 110 AudioObserver* audio_observer() const { |
108 return audio_observer_; | 111 return audio_observer_; |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
215 AudioObserver* audio_observer_; | 218 AudioObserver* audio_observer_; |
216 BluetoothObserver* bluetooth_observer_; | 219 BluetoothObserver* bluetooth_observer_; |
217 BrightnessObserver* brightness_observer_; | 220 BrightnessObserver* brightness_observer_; |
218 CapsLockObserver* caps_lock_observer_; | 221 CapsLockObserver* caps_lock_observer_; |
219 ClockObserver* clock_observer_; | 222 ClockObserver* clock_observer_; |
220 DriveObserver* drive_observer_; | 223 DriveObserver* drive_observer_; |
221 IMEObserver* ime_observer_; | 224 IMEObserver* ime_observer_; |
222 LocaleObserver* locale_observer_; | 225 LocaleObserver* locale_observer_; |
223 NetworkObserver* network_observer_; | 226 NetworkObserver* network_observer_; |
224 PowerStatusObserver* power_status_observer_; | 227 PowerStatusObserver* power_status_observer_; |
228 std::vector<PowerStatusObserver*> power_status_observers_; | |
stevenjb
2012/06/07 01:31:18
Do we need both power_status_observer_ and power_s
jennyz
2012/06/07 22:06:52
Done.
| |
225 UpdateObserver* update_observer_; | 229 UpdateObserver* update_observer_; |
226 UserObserver* user_observer_; | 230 UserObserver* user_observer_; |
227 | 231 |
228 // Bubble for default and detailed views. | 232 // Bubble for default and detailed views. |
229 scoped_ptr<internal::SystemTrayBubble> bubble_; | 233 scoped_ptr<internal::SystemTrayBubble> bubble_; |
230 | 234 |
231 // Buble for notifications. | 235 // Buble for notifications. |
232 scoped_ptr<internal::SystemTrayBubble> notification_bubble_; | 236 scoped_ptr<internal::SystemTrayBubble> notification_bubble_; |
233 | 237 |
234 // See description agove getter. | 238 // See description agove getter. |
235 bool should_show_launcher_; | 239 bool should_show_launcher_; |
236 | 240 |
237 // Shelf alignment. | 241 // Shelf alignment. |
238 ShelfAlignment shelf_alignment_; | 242 ShelfAlignment shelf_alignment_; |
239 | 243 |
240 scoped_ptr<internal::SystemTrayLayerAnimationObserver> | 244 scoped_ptr<internal::SystemTrayLayerAnimationObserver> |
241 layer_animation_observer_; | 245 layer_animation_observer_; |
242 | 246 |
243 // Keep track of the default view height so that when we create detailed | 247 // Keep track of the default view height so that when we create detailed |
244 // views directly (e.g. from a notification) we know what height to use. | 248 // views directly (e.g. from a notification) we know what height to use. |
245 int default_bubble_height_; | 249 int default_bubble_height_; |
246 | 250 |
247 DISALLOW_COPY_AND_ASSIGN(SystemTray); | 251 DISALLOW_COPY_AND_ASSIGN(SystemTray); |
248 }; | 252 }; |
249 | 253 |
250 } // namespace ash | 254 } // namespace ash |
251 | 255 |
252 #endif // ASH_SYSTEM_TRAY_SYSTEM_TRAY_H_ | 256 #endif // ASH_SYSTEM_TRAY_SYSTEM_TRAY_H_ |
OLD | NEW |