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 |
91 bool shown_status_balloon_; | |
sky
2013/06/20 17:22:01
I don't see you using this any where.
dewittj
2013/06/20 17:51:51
Done.
| |
84 StatusIcon* status_icon_; | 92 StatusIcon* status_icon_; |
85 bool message_center_visible_; | 93 bool message_center_visible_; |
86 scoped_ptr<MessageCenterTray> message_center_tray_; | 94 scoped_ptr<MessageCenterTray> message_center_tray_; |
87 gfx::Point mouse_click_point_; | 95 gfx::Point mouse_click_point_; |
88 | 96 |
89 bool should_update_tray_content_; | 97 bool should_update_tray_content_; |
90 | 98 |
91 DISALLOW_COPY_AND_ASSIGN(WebNotificationTray); | 99 DISALLOW_COPY_AND_ASSIGN(WebNotificationTray); |
92 }; | 100 }; |
93 | 101 |
94 } // namespace message_center | 102 } // namespace message_center |
95 | 103 |
96 #endif // CHROME_BROWSER_UI_VIEWS_MESSAGE_CENTER_WEB_NOTIFICATION_TRAY_H_ | 104 #endif // CHROME_BROWSER_UI_VIEWS_MESSAGE_CENTER_WEB_NOTIFICATION_TRAY_H_ |
OLD | NEW |