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_STATUS_AREA_WIDGET_H_ | 5 #ifndef ASH_SYSTEM_STATUS_AREA_WIDGET_H_ |
6 #define ASH_SYSTEM_STATUS_AREA_WIDGET_H_ | 6 #define ASH_SYSTEM_STATUS_AREA_WIDGET_H_ |
7 | 7 |
8 #include "ash/ash_export.h" | 8 #include "ash/ash_export.h" |
9 #include "ash/launcher/background_animator.h" | 9 #include "ash/launcher/background_animator.h" |
10 #include "ash/system/user/login_status.h" | 10 #include "ash/system/user/login_status.h" |
11 #include "ash/wm/shelf_types.h" | 11 #include "ash/wm/shelf_types.h" |
12 #include "ui/views/widget/widget.h" | 12 #include "ui/views/widget/widget.h" |
13 | 13 |
14 namespace ash { | 14 namespace ash { |
15 | 15 |
16 class ShellDelegate; | 16 class ShellDelegate; |
17 class SystemTray; | 17 class SystemTray; |
18 class SystemTrayDelegate; | 18 class SystemTrayDelegate; |
19 class WebNotificationTray; | 19 class WebNotificationTray; |
20 | 20 |
21 namespace internal { | 21 namespace internal { |
22 | 22 |
23 class StatusAreaWidgetDelegate; | 23 class StatusAreaWidgetDelegate; |
24 | 24 |
25 class ASH_EXPORT StatusAreaWidget : public views::Widget { | 25 class ASH_EXPORT StatusAreaWidget : public views::Widget { |
26 public: | 26 public: |
27 enum UserAction { | |
28 NON_USER_ACTION, | |
29 USER_ACTION | |
30 }; | |
31 | |
32 StatusAreaWidget(); | 27 StatusAreaWidget(); |
33 virtual ~StatusAreaWidget(); | 28 virtual ~StatusAreaWidget(); |
34 | 29 |
35 // Creates the SystemTray and the WebNotificationTray. | 30 // Creates the SystemTray and the WebNotificationTray. |
36 void CreateTrayViews(ShellDelegate* shell_delegate); | 31 void CreateTrayViews(ShellDelegate* shell_delegate); |
37 | 32 |
38 // Destroys the system tray and web notification tray. Called before | 33 // Destroys the system tray and web notification tray. Called before |
39 // tearing down the windows to avoid shutdown ordering issues. | 34 // tearing down the windows to avoid shutdown ordering issues. |
40 void Shutdown(); | 35 void Shutdown(); |
41 | 36 |
42 // Update the alignment of the widget and tray views. | 37 // Update the alignment of the widget and tray views. |
43 void SetShelfAlignment(ShelfAlignment alignment); | 38 void SetShelfAlignment(ShelfAlignment alignment); |
44 | 39 |
45 // Update whether to paint a background for each tray view. | 40 // Update whether to paint a background for each tray view. |
46 void SetPaintsBackground( | 41 void SetPaintsBackground( |
47 bool value, | 42 bool value, |
48 internal::BackgroundAnimator::ChangeType change_type); | 43 internal::BackgroundAnimator::ChangeType change_type); |
49 | 44 |
50 // Always used to show/hide the web notification tray. These handle any logic | 45 // Hide any non system (i.e. web) notifications. |
51 // with hiding/supressing notifications from the system tray. | 46 void HideNonSystemNotifications(); |
52 void ShowWebNotificationBubble(UserAction user_action); | 47 |
53 void HideWebNotificationBubble(); | 48 // Toggle the visibility of system notifications. |
| 49 void SetHideSystemNotifications(bool hide); |
| 50 |
| 51 // Returns true if it is OK to show a non system notification. |
| 52 bool ShouldShowNonSystemNotifications(); |
54 | 53 |
55 // Called by the client when the login status changes. Caches login_status | 54 // Called by the client when the login status changes. Caches login_status |
56 // and calls UpdateAfterLoginStatusChange for the system tray and the web | 55 // and calls UpdateAfterLoginStatusChange for the system tray and the web |
57 // notification tray. | 56 // notification tray. |
58 void UpdateAfterLoginStatusChange(user::LoginStatus login_status); | 57 void UpdateAfterLoginStatusChange(user::LoginStatus login_status); |
59 | 58 |
60 SystemTray* system_tray() { return system_tray_; } | 59 SystemTray* system_tray() { return system_tray_; } |
61 SystemTrayDelegate* system_tray_delegate() { | 60 SystemTrayDelegate* system_tray_delegate() { |
62 return system_tray_delegate_.get(); | 61 return system_tray_delegate_.get(); |
63 } | 62 } |
(...skipping 14 matching lines...) Expand all Loading... |
78 WebNotificationTray* web_notification_tray_; | 77 WebNotificationTray* web_notification_tray_; |
79 user::LoginStatus login_status_; | 78 user::LoginStatus login_status_; |
80 | 79 |
81 DISALLOW_COPY_AND_ASSIGN(StatusAreaWidget); | 80 DISALLOW_COPY_AND_ASSIGN(StatusAreaWidget); |
82 }; | 81 }; |
83 | 82 |
84 } // namespace internal | 83 } // namespace internal |
85 } // namespace ash | 84 } // namespace ash |
86 | 85 |
87 #endif // ASH_SYSTEM_STATUS_AREA_WIDGET_H_ | 86 #endif // ASH_SYSTEM_STATUS_AREA_WIDGET_H_ |
OLD | NEW |