| 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_NOTIFICATION_WEB_NOTIFICATION_TRAY_H_ | 5 #ifndef ASH_SYSTEM_NOTIFICATION_WEB_NOTIFICATION_TRAY_H_ |
| 6 #define ASH_SYSTEM_NOTIFICATION_WEB_NOTIFICATION_TRAY_H_ | 6 #define ASH_SYSTEM_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/tray/tray_views.h" | 10 #include "ash/system/tray/tray_views.h" |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 // Returns true if the message center bubble is visible. | 117 // Returns true if the message center bubble is visible. |
| 118 bool IsMessageCenterBubbleVisible() const; | 118 bool IsMessageCenterBubbleVisible() const; |
| 119 | 119 |
| 120 // Returns true if the mouse is inside the notification bubble. | 120 // Returns true if the mouse is inside the notification bubble. |
| 121 bool IsMouseInNotificationBubble() const; | 121 bool IsMouseInNotificationBubble() const; |
| 122 | 122 |
| 123 // Overridden from TrayBackgroundView. | 123 // Overridden from TrayBackgroundView. |
| 124 virtual void SetShelfAlignment(ShelfAlignment alignment) OVERRIDE; | 124 virtual void SetShelfAlignment(ShelfAlignment alignment) OVERRIDE; |
| 125 virtual void AnchorUpdated() OVERRIDE; | 125 virtual void AnchorUpdated() OVERRIDE; |
| 126 virtual string16 GetAccessibleName() OVERRIDE; | 126 virtual string16 GetAccessibleName() OVERRIDE; |
| 127 virtual void HideBubble(TrayBubbleView* bubble_view) OVERRIDE; |
| 128 virtual bool ClickedOutsideBubble() OVERRIDE; |
| 127 | 129 |
| 128 // Overridden from internal::ActionableView. | 130 // Overridden from internal::ActionableView. |
| 129 virtual bool PerformAction(const ui::Event& event) OVERRIDE; | 131 virtual bool PerformAction(const ui::Event& event) OVERRIDE; |
| 130 | 132 |
| 131 // Overridden from ButtonListener. | 133 // Overridden from ButtonListener. |
| 132 virtual void ButtonPressed(views::Button* sender, | 134 virtual void ButtonPressed(views::Button* sender, |
| 133 const ui::Event& event) OVERRIDE; | 135 const ui::Event& event) OVERRIDE; |
| 134 | 136 |
| 135 // Constants exposed for unit tests: | 137 // Constants exposed for unit tests: |
| 136 static const size_t kMaxVisibleTrayNotifications; | 138 static const size_t kMaxVisibleTrayNotifications; |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 | 182 |
| 181 // Hides the notification bubble if visible. | 183 // Hides the notification bubble if visible. |
| 182 void HidePopupBubble(); | 184 void HidePopupBubble(); |
| 183 | 185 |
| 184 // Updates the tray icon and visibility. | 186 // Updates the tray icon and visibility. |
| 185 void UpdateTray(); | 187 void UpdateTray(); |
| 186 | 188 |
| 187 // As above but also updates any visible bubble. | 189 // As above but also updates any visible bubble. |
| 188 void UpdateTrayAndBubble(); | 190 void UpdateTrayAndBubble(); |
| 189 | 191 |
| 190 // Hides the specified bubble (called when |bubble| is closed from Views). | |
| 191 void HideBubble(message_center::WebNotificationBubble* bubble); | |
| 192 | |
| 193 // Testing accessors. | 192 // Testing accessors. |
| 194 size_t GetNotificationCountForTest() const; | 193 size_t GetNotificationCountForTest() const; |
| 195 bool HasNotificationForTest(const std::string& id) const; | 194 bool HasNotificationForTest(const std::string& id) const; |
| 196 void RemoveAllNotificationsForTest(); | 195 void RemoveAllNotificationsForTest(); |
| 197 size_t GetMessageCenterNotificationCountForTest() const; | 196 size_t GetMessageCenterNotificationCountForTest() const; |
| 198 size_t GetPopupNotificationCountForTest() const; | 197 size_t GetPopupNotificationCountForTest() const; |
| 199 | 198 |
| 200 message_center::WebNotificationList* notification_list() { | 199 message_center::WebNotificationList* notification_list() { |
| 201 return notification_list_.get(); | 200 return notification_list_.get(); |
| 202 } | 201 } |
| (...skipping 10 matching lines...) Expand all Loading... |
| 213 views::ImageButton* button_; | 212 views::ImageButton* button_; |
| 214 Delegate* delegate_; | 213 Delegate* delegate_; |
| 215 bool show_message_center_on_unlock_; | 214 bool show_message_center_on_unlock_; |
| 216 | 215 |
| 217 DISALLOW_COPY_AND_ASSIGN(WebNotificationTray); | 216 DISALLOW_COPY_AND_ASSIGN(WebNotificationTray); |
| 218 }; | 217 }; |
| 219 | 218 |
| 220 } // namespace ash | 219 } // namespace ash |
| 221 | 220 |
| 222 #endif // ASH_SYSTEM_NOTIFICATION_WEB_NOTIFICATION_TRAY_H_ | 221 #endif // ASH_SYSTEM_NOTIFICATION_WEB_NOTIFICATION_TRAY_H_ |
| OLD | NEW |