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_WEB_NOTIFICATION_WEB_NOTIFICATION_TRAY_H_ | 5 #ifndef ASH_SYSTEM_WEB_NOTIFICATION_WEB_NOTIFICATION_TRAY_H_ |
6 #define ASH_SYSTEM_WEB_NOTIFICATION_WEB_NOTIFICATION_TRAY_H_ | 6 #define ASH_SYSTEM_WEB_NOTIFICATION_WEB_NOTIFICATION_TRAY_H_ |
7 | 7 |
8 #include "ash/ash_export.h" | 8 #include "ash/ash_export.h" |
9 #include "ash/system/tray/tray_background_view.h" | 9 #include "ash/system/tray/tray_background_view.h" |
10 #include "ash/system/user/login_status.h" | 10 #include "ash/system/user/login_status.h" |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 : public internal::TrayBackgroundView, | 48 : public internal::TrayBackgroundView, |
49 public views::TrayBubbleView::Delegate, | 49 public views::TrayBubbleView::Delegate, |
50 public message_center::MessageCenterTrayDelegate, | 50 public message_center::MessageCenterTrayDelegate, |
51 public views::ButtonListener, | 51 public views::ButtonListener, |
52 public base::SupportsWeakPtr<WebNotificationTray> { | 52 public base::SupportsWeakPtr<WebNotificationTray> { |
53 public: | 53 public: |
54 explicit WebNotificationTray( | 54 explicit WebNotificationTray( |
55 internal::StatusAreaWidget* status_area_widget); | 55 internal::StatusAreaWidget* status_area_widget); |
56 virtual ~WebNotificationTray(); | 56 virtual ~WebNotificationTray(); |
57 | 57 |
58 // Set whether or not the popup notifications should be hidden. | 58 // Sets the height of the system tray from the edge of the work area so that |
59 void SetHidePopupBubble(bool hide); | 59 // the notification popups don't overlap with the tray. Passes 0 if no UI is |
| 60 // shown in the system tray side. |
| 61 void SetSystemTrayHeight(int height); |
60 | 62 |
61 // Updates tray visibility login status of the system changes. | 63 // Updates tray visibility login status of the system changes. |
62 void UpdateAfterLoginStatusChange(user::LoginStatus login_status); | 64 void UpdateAfterLoginStatusChange(user::LoginStatus login_status); |
63 | 65 |
64 // Returns true if it should block the auto hide behavior of the launcher. | 66 // Returns true if it should block the auto hide behavior of the launcher. |
65 bool ShouldBlockLauncherAutoHide() const; | 67 bool ShouldBlockLauncherAutoHide() const; |
66 | 68 |
67 // Returns true if the message center bubble is visible. | 69 // Returns true if the message center bubble is visible. |
68 bool IsMessageCenterBubbleVisible() const; | 70 bool IsMessageCenterBubbleVisible() const; |
69 | 71 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 virtual bool ShowPopups() OVERRIDE; | 107 virtual bool ShowPopups() OVERRIDE; |
106 virtual void HidePopups() OVERRIDE; | 108 virtual void HidePopups() OVERRIDE; |
107 virtual bool ShowNotifierSettings() OVERRIDE; | 109 virtual bool ShowNotifierSettings() OVERRIDE; |
108 | 110 |
109 // Overridden from TrayBackgroundView. | 111 // Overridden from TrayBackgroundView. |
110 virtual bool IsPressed() OVERRIDE; | 112 virtual bool IsPressed() OVERRIDE; |
111 | 113 |
112 message_center::MessageCenter* message_center(); | 114 message_center::MessageCenter* message_center(); |
113 | 115 |
114 private: | 116 private: |
| 117 friend class WebNotificationTrayTest; |
| 118 |
115 FRIEND_TEST_ALL_PREFIXES(WebNotificationTrayTest, WebNotifications); | 119 FRIEND_TEST_ALL_PREFIXES(WebNotificationTrayTest, WebNotifications); |
116 FRIEND_TEST_ALL_PREFIXES(WebNotificationTrayTest, WebNotificationPopupBubble); | 120 FRIEND_TEST_ALL_PREFIXES(WebNotificationTrayTest, WebNotificationPopupBubble); |
117 FRIEND_TEST_ALL_PREFIXES(WebNotificationTrayTest, | 121 FRIEND_TEST_ALL_PREFIXES(WebNotificationTrayTest, |
118 ManyMessageCenterNotifications); | 122 ManyMessageCenterNotifications); |
119 FRIEND_TEST_ALL_PREFIXES(WebNotificationTrayTest, ManyPopupNotifications); | 123 FRIEND_TEST_ALL_PREFIXES(WebNotificationTrayTest, ManyPopupNotifications); |
120 FRIEND_TEST_ALL_PREFIXES(WebNotificationTrayTest, PopupShownOnBothDisplays); | 124 FRIEND_TEST_ALL_PREFIXES(WebNotificationTrayTest, PopupShownOnBothDisplays); |
| 125 FRIEND_TEST_ALL_PREFIXES(WebNotificationTrayTest, PopupAndSystemTray); |
121 | 126 |
122 void UpdateTrayContent(); | 127 void UpdateTrayContent(); |
123 | 128 |
124 // The actual process to show the message center. Set |show_settings| to true | 129 // The actual process to show the message center. Set |show_settings| to true |
125 // if the message center should be initialized with the settings visible. | 130 // if the message center should be initialized with the settings visible. |
126 // Returns true if the center is successfully created. | 131 // Returns true if the center is successfully created. |
127 bool ShowMessageCenterInternal(bool show_settings); | 132 bool ShowMessageCenterInternal(bool show_settings); |
128 | 133 |
129 // Queries login status and the status area widget to determine visibility of | 134 // Queries login status and the status area widget to determine visibility of |
130 // the message center. | 135 // the message center. |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 | 167 |
163 // Observes the work area for |popup_collection_| and notifies to it. | 168 // Observes the work area for |popup_collection_| and notifies to it. |
164 scoped_ptr<internal::WorkAreaObserver> work_area_observer_; | 169 scoped_ptr<internal::WorkAreaObserver> work_area_observer_; |
165 | 170 |
166 DISALLOW_COPY_AND_ASSIGN(WebNotificationTray); | 171 DISALLOW_COPY_AND_ASSIGN(WebNotificationTray); |
167 }; | 172 }; |
168 | 173 |
169 } // namespace ash | 174 } // namespace ash |
170 | 175 |
171 #endif // ASH_SYSTEM_WEB_NOTIFICATION_WEB_NOTIFICATION_TRAY_H_ | 176 #endif // ASH_SYSTEM_WEB_NOTIFICATION_WEB_NOTIFICATION_TRAY_H_ |
OLD | NEW |