| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 CHROME_BROWSER_UI_VIEWS_MESSAGE_CENTER_WEB_NOTIFICATION_TRAY_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_MESSAGE_CENTER_WEB_NOTIFICATION_TRAY_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_MESSAGE_CENTER_WEB_NOTIFICATION_TRAY_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_MESSAGE_CENTER_WEB_NOTIFICATION_TRAY_H_ |
| 7 | 7 |
| 8 #include "base/memory/weak_ptr.h" | 8 #include "base/memory/weak_ptr.h" |
| 9 #include "chrome/browser/status_icons/status_icon_observer.h" | 9 #include "chrome/browser/status_icons/status_icon_observer.h" |
| 10 #include "ui/base/models/simple_menu_model.h" | 10 #include "ui/base/models/simple_menu_model.h" |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 // These are forwarded to WebNotificationTray by | 54 // These are forwarded to WebNotificationTray by |
| 55 // NotificationBubbleWrapper classes since they don't have enough | 55 // NotificationBubbleWrapper classes since they don't have enough |
| 56 // context to provide the required data for TrayBubbleView::Delegate. | 56 // context to provide the required data for TrayBubbleView::Delegate. |
| 57 gfx::Rect GetMessageCenterAnchor(); | 57 gfx::Rect GetMessageCenterAnchor(); |
| 58 gfx::Rect GetPopupAnchor(); | 58 gfx::Rect GetPopupAnchor(); |
| 59 gfx::NativeView GetBubbleWindowContainer(); | 59 gfx::NativeView GetBubbleWindowContainer(); |
| 60 views::TrayBubbleView::AnchorAlignment GetAnchorAlignment(); | 60 views::TrayBubbleView::AnchorAlignment GetAnchorAlignment(); |
| 61 | 61 |
| 62 // StatusIconObserver implementation. | 62 // StatusIconObserver implementation. |
| 63 virtual void OnStatusIconClicked() OVERRIDE; | 63 virtual void OnStatusIconClicked() OVERRIDE; |
| 64 virtual void OnBalloonClicked() OVERRIDE; |
| 64 | 65 |
| 65 // Changes the icon and hovertext based on number of unread notifications. | 66 // Changes the icon and hovertext based on number of unread notifications. |
| 66 void UpdateStatusIcon(); | 67 void UpdateStatusIcon(); |
| 67 void HideBubbleWithView(const views::TrayBubbleView* bubble_view); | 68 void HideBubbleWithView(const views::TrayBubbleView* bubble_view); |
| 68 | 69 |
| 70 #if defined(OS_WIN) |
| 71 // This shows a platform-specific balloon informing the user of the existence |
| 72 // of the message center in the status tray area. |
| 73 void DisplayFirstRunBalloon(); |
| 74 #endif |
| 75 |
| 69 private: | 76 private: |
| 70 FRIEND_TEST_ALL_PREFIXES(WebNotificationTrayTest, WebNotifications); | 77 FRIEND_TEST_ALL_PREFIXES(WebNotificationTrayTest, WebNotifications); |
| 71 FRIEND_TEST_ALL_PREFIXES(WebNotificationTrayTest, WebNotificationPopupBubble); | 78 FRIEND_TEST_ALL_PREFIXES(WebNotificationTrayTest, WebNotificationPopupBubble); |
| 72 FRIEND_TEST_ALL_PREFIXES(WebNotificationTrayTest, | 79 FRIEND_TEST_ALL_PREFIXES(WebNotificationTrayTest, |
| 73 ManyMessageCenterNotifications); | 80 ManyMessageCenterNotifications); |
| 74 FRIEND_TEST_ALL_PREFIXES(WebNotificationTrayTest, ManyPopupNotifications); | 81 FRIEND_TEST_ALL_PREFIXES(WebNotificationTrayTest, ManyPopupNotifications); |
| 75 | 82 |
| 76 StatusIcon* GetStatusIcon(); | 83 StatusIcon* GetStatusIcon(); |
| 77 void DestroyStatusIcon(); | 84 void DestroyStatusIcon(); |
| 78 void AddQuietModeMenu(StatusIcon* status_icon); | 85 void AddQuietModeMenu(StatusIcon* status_icon); |
| 79 message_center::MessageCenterBubble* GetMessageCenterBubbleForTest(); | 86 message_center::MessageCenterBubble* GetMessageCenterBubbleForTest(); |
| 80 | 87 |
| 81 scoped_ptr<internal::NotificationBubbleWrapper> message_center_bubble_; | 88 scoped_ptr<internal::NotificationBubbleWrapper> message_center_bubble_; |
| 82 scoped_ptr<message_center::MessagePopupCollection> popup_collection_; | 89 scoped_ptr<message_center::MessagePopupCollection> popup_collection_; |
| 83 | 90 |
| 84 StatusIcon* status_icon_; | 91 StatusIcon* status_icon_; |
| 85 bool message_center_visible_; | 92 bool message_center_visible_; |
| 86 scoped_ptr<MessageCenterTray> message_center_tray_; | 93 scoped_ptr<MessageCenterTray> message_center_tray_; |
| 87 gfx::Point mouse_click_point_; | 94 gfx::Point mouse_click_point_; |
| 88 | 95 |
| 89 bool should_update_tray_content_; | 96 bool should_update_tray_content_; |
| 90 | 97 |
| 91 DISALLOW_COPY_AND_ASSIGN(WebNotificationTray); | 98 DISALLOW_COPY_AND_ASSIGN(WebNotificationTray); |
| 92 }; | 99 }; |
| 93 | 100 |
| 94 } // namespace message_center | 101 } // namespace message_center |
| 95 | 102 |
| 96 #endif // CHROME_BROWSER_UI_VIEWS_MESSAGE_CENTER_WEB_NOTIFICATION_TRAY_H_ | 103 #endif // CHROME_BROWSER_UI_VIEWS_MESSAGE_CENTER_WEB_NOTIFICATION_TRAY_H_ |
| OLD | NEW |