OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_UI_VIEWS_MESSAGE_CENTER_MESSAGE_CENTER_TRAY_HOST_WIN_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_MESSAGE_CENTER_MESSAGE_CENTER_TRAY_HOST_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/message_center/message_center_tray_host.h" |
| 11 #include "ui/views/bubble/tray_bubble_view.h" |
| 12 |
| 13 class StatusIcon; |
| 14 template <typename T> struct DefaultSingletonTraits; |
| 15 |
| 16 namespace message_center { |
| 17 class MessageCenter; |
| 18 } |
| 19 |
| 20 namespace views { |
| 21 class Widget; |
| 22 } |
| 23 |
| 24 namespace ui { |
| 25 |
| 26 // A Message Center Tray Host class that manages a system tray icon. The |
| 27 // notification popups will be displayed in the corner of the screen and the |
| 28 // message center will be displayed by the system tray icon on click. |
| 29 // TODO(dewittj): quiet mode. |
| 30 class MessageCenterTrayHostWin |
| 31 : public MessageCenterTrayHost, |
| 32 public StatusIconObserver { |
| 33 public: |
| 34 static MessageCenterTrayHostWin* GetInstance(); |
| 35 virtual ~MessageCenterTrayHostWin(); |
| 36 |
| 37 virtual message_center::MessageCenter* message_center() OVERRIDE; |
| 38 |
| 39 // MessageCenterTrayHost implementation. |
| 40 virtual void OnMessageCenterTrayChanged() OVERRIDE; |
| 41 virtual string16 GetAccessibleNameForBubble() OVERRIDE; |
| 42 virtual void OnShowMessageCenterBubble() OVERRIDE; |
| 43 virtual void OnHideMessageCenterBubble() OVERRIDE; |
| 44 virtual gfx::Rect GetAnchorRect( |
| 45 views::Widget* anchor_widget, |
| 46 views::TrayBubbleView::AnchorType anchor_type, |
| 47 views::TrayBubbleView::AnchorAlignment anchor_alignment) OVERRIDE; |
| 48 virtual bool CanShowPopups() OVERRIDE; |
| 49 virtual gfx::NativeView GetBubbleWindowContainer() OVERRIDE; |
| 50 virtual views::TrayBubbleView::AnchorAlignment GetAnchorAlignment() OVERRIDE; |
| 51 virtual void UpdateInitParams( |
| 52 views::TrayBubbleView::InitParams* init_params) OVERRIDE; |
| 53 // There is no view associated with the system tray icon. |
| 54 virtual views::View* GetAnchorView() OVERRIDE { return NULL; } |
| 55 |
| 56 // StatusIconObserver override. |
| 57 virtual void OnStatusIconClicked(); |
| 58 |
| 59 private: |
| 60 MessageCenterTrayHostWin(); |
| 61 void UpdateAnchorRect(); |
| 62 |
| 63 StatusIcon* status_icon_; |
| 64 bool message_center_visible_; |
| 65 MessageCenterTray* message_center_tray_; |
| 66 gfx::Rect message_center_anchor_rect_; |
| 67 gfx::Rect popup_anchor_rect_; |
| 68 |
| 69 friend struct DefaultSingletonTraits<MessageCenterTrayHostWin>; |
| 70 DISALLOW_COPY_AND_ASSIGN(MessageCenterTrayHostWin); |
| 71 }; |
| 72 |
| 73 } // namespace ui |
| 74 |
| 75 #endif // CHROME_BROWSER_UI_VIEWS_MESSAGE_CENTER_MESSAGE_CENTER_TRAY_HOST_WIN_H
_ |
OLD | NEW |