Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_UI_VIEWS_MESSAGE_CENTER_WEB_NOTIFICATION_TRAY_WIN_H_ | |
| 6 #define CHROME_BROWSER_UI_VIEWS_MESSAGE_CENTER_WEB_NOTIFICATION_TRAY_WIN_H_ | |
| 7 | |
| 8 #include "chrome/browser/status_icons/status_icon_observer.h" | |
| 9 #include "ui/message_center/message_center_tray.h" | |
| 10 #include "ui/views/bubble/tray_bubble_view.h" | |
| 11 | |
| 12 class StatusIcon; | |
| 13 | |
| 14 namespace message_center { | |
| 15 class MessageCenter; | |
| 16 class MessageCenterBubble; | |
| 17 class MessagePopupBubble; | |
| 18 } | |
| 19 | |
| 20 namespace views { | |
| 21 class Widget; | |
| 22 } | |
| 23 | |
| 24 namespace ui { | |
| 25 | |
| 26 namespace internal { | |
| 27 class NotificationBubbleWrapperWin; | |
| 28 } | |
| 29 | |
| 30 // A Message Center Tray Delegate class that manages a system tray icon. The | |
|
Pete Williamson
2013/01/23 19:52:16
Perhaps "A class derived from the Message Center T
dewittj
2013/01/23 22:07:52
Done.
| |
| 31 // notification popups will be displayed in the corner of the screen and the | |
| 32 // message center will be displayed by the system tray icon on click. | |
| 33 // TODO(dewittj): quiet mode. | |
| 34 class WebNotificationTrayWin | |
| 35 : public MessageCenterTrayDelegate, | |
| 36 public StatusIconObserver { | |
| 37 public: | |
| 38 WebNotificationTrayWin(); | |
| 39 virtual ~WebNotificationTrayWin(); | |
| 40 | |
| 41 virtual message_center::MessageCenter* message_center(); | |
| 42 | |
| 43 // MessageCenterTrayDelegate implementation. | |
| 44 virtual bool ShowPopups(message_center::MessageBubbleBase* bubble) OVERRIDE; | |
| 45 virtual void HidePopups() OVERRIDE; | |
| 46 virtual bool ShowMessageCenter( | |
| 47 message_center::MessageBubbleBase* bubble) OVERRIDE; | |
| 48 virtual void HideMessageCenter() OVERRIDE; | |
| 49 virtual void UpdateMessageCenter() OVERRIDE; | |
| 50 virtual void UpdatePopups() OVERRIDE; | |
| 51 virtual void OnMessageCenterTrayChanged() OVERRIDE; | |
| 52 | |
| 53 virtual gfx::Rect GetAnchorRect( | |
| 54 gfx::Size preferred_size, | |
| 55 views::TrayBubbleView::AnchorType anchor_type, | |
| 56 views::TrayBubbleView::AnchorAlignment anchor_alignment); | |
| 57 virtual gfx::NativeView GetBubbleWindowContainer(); | |
| 58 virtual views::TrayBubbleView::AnchorAlignment GetAnchorAlignment(); | |
| 59 | |
| 60 // StatusIconObserver override. | |
| 61 virtual void OnStatusIconClicked() OVERRIDE; | |
| 62 | |
| 63 virtual void HideBubbleWithView( | |
| 64 const views::TrayBubbleView* bubble_view); | |
| 65 | |
| 66 private: | |
| 67 FRIEND_TEST_ALL_PREFIXES(WebNotificationTrayWinTest, WebNotifications); | |
| 68 FRIEND_TEST_ALL_PREFIXES(WebNotificationTrayWinTest, | |
| 69 WebNotificationPopupBubble); | |
| 70 FRIEND_TEST_ALL_PREFIXES(WebNotificationTrayWinTest, | |
| 71 ManyMessageCenterNotifications); | |
| 72 FRIEND_TEST_ALL_PREFIXES(WebNotificationTrayWinTest, ManyPopupNotifications); | |
| 73 | |
| 74 void UpdateAnchorRect(); | |
| 75 message_center::MessagePopupBubble* GetPopupBubbleForTest(); | |
| 76 message_center::MessageCenterBubble* GetMessageCenterBubbleForTest(); | |
| 77 | |
| 78 scoped_ptr<internal::NotificationBubbleWrapperWin> popup_bubble_; | |
| 79 scoped_ptr<internal::NotificationBubbleWrapperWin> message_center_bubble_; | |
| 80 | |
| 81 StatusIcon* status_icon_; | |
| 82 bool message_center_visible_; | |
| 83 scoped_ptr<MessageCenterTray> message_center_tray_; | |
| 84 gfx::Rect message_center_anchor_rect_; | |
| 85 gfx::Rect popup_anchor_rect_; | |
| 86 | |
| 87 DISALLOW_COPY_AND_ASSIGN(WebNotificationTrayWin); | |
| 88 }; | |
| 89 | |
| 90 } // namespace ui | |
| 91 | |
| 92 #endif // CHROME_BROWSER_UI_VIEWS_MESSAGE_CENTER_WEB_NOTIFICATION_TRAY_WIN_H_ | |
| OLD | NEW |