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_WEB_NOTIFICATION_WEB_NOTIFICATION_TRAY_H_ | 5 #ifndef ASH_SYSTEM_WEB_NOTIFICATION_WEB_NOTIFICATION_TRAY_H_ |
6 #define ASH_SYSTEM_WEB_NOTIFICATION_WEB_NOTIFICATION_TRAY_H_ | 6 #define ASH_SYSTEM_WEB_NOTIFICATION_WEB_NOTIFICATION_TRAY_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "ash/ash_export.h" | 10 #include "ash/ash_export.h" |
(...skipping 27 matching lines...) Expand all Loading... |
38 | 38 |
39 // Status area tray for showing browser and app notifications. This hosts | 39 // Status area tray for showing browser and app notifications. This hosts |
40 // a MessageCenter class which manages the notification list. This class | 40 // a MessageCenter class which manages the notification list. This class |
41 // contains the Ash specific tray implementation. | 41 // contains the Ash specific tray implementation. |
42 // | 42 // |
43 // Note: These are not related to system notifications (i.e NotificationView | 43 // Note: These are not related to system notifications (i.e NotificationView |
44 // generated by SystemTrayItem). Visibility of one notification type or other | 44 // generated by SystemTrayItem). Visibility of one notification type or other |
45 // is controlled by StatusAreaWidget. | 45 // is controlled by StatusAreaWidget. |
46 class ASH_EXPORT WebNotificationTray | 46 class ASH_EXPORT WebNotificationTray |
47 : public TrayBackgroundView, | 47 : public TrayBackgroundView, |
48 public views::TrayBubbleView::Delegate, | |
49 public message_center::MessageCenterTrayDelegate, | 48 public message_center::MessageCenterTrayDelegate, |
50 public base::SupportsWeakPtr<WebNotificationTray>, | 49 public base::SupportsWeakPtr<WebNotificationTray>, |
51 public ui::SimpleMenuModel::Delegate { | 50 public ui::SimpleMenuModel::Delegate { |
52 public: | 51 public: |
53 WebNotificationTray(Shelf* shelf, | 52 WebNotificationTray(Shelf* shelf, |
54 aura::Window* status_area_window, | 53 aura::Window* status_area_window, |
55 SystemTray* system_tray); | 54 SystemTray* system_tray); |
56 ~WebNotificationTray() override; | 55 ~WebNotificationTray() override; |
57 | 56 |
58 static void DisableAnimationsForTest(bool disable); | 57 static void DisableAnimationsForTest(bool disable); |
59 | 58 |
60 // Sets the height of the system tray bubble (or legacy notification bubble) | 59 // Sets the height of the system tray bubble (or legacy notification bubble) |
61 // from the edge of the work area so that the web notification popups don't | 60 // from the edge of the work area so that the web notification popups don't |
62 // overlap with the tray. Pass 0 if no bubble is shown. | 61 // overlap with the tray. Pass 0 if no bubble is shown. |
63 void SetTrayBubbleHeight(int height); | 62 void SetTrayBubbleHeight(int height); |
64 | 63 |
65 // Returns the current tray bubble height or 0 if there is no bubble. | 64 // Returns the current tray bubble height or 0 if there is no bubble. |
66 int tray_bubble_height_for_test() const; | 65 int tray_bubble_height_for_test() const; |
67 | 66 |
68 // Returns true if it should block the auto hide behavior of the shelf. | 67 // Returns true if it should block the auto hide behavior of the shelf. |
69 bool ShouldBlockShelfAutoHide() const; | 68 bool ShouldBlockShelfAutoHide() const; |
70 | 69 |
71 // Returns true if the message center bubble is visible. | 70 // Returns true if the message center bubble is visible. |
72 bool IsMessageCenterBubbleVisible() const; | 71 bool IsMessageCenterBubbleVisible() const; |
73 | 72 |
74 // Shows the message center bubble. | |
75 void ShowMessageCenterBubble(); | |
76 | |
77 // Called when the login status is changed. | 73 // Called when the login status is changed. |
78 void UpdateAfterLoginStatusChange(LoginStatus login_status); | 74 void UpdateAfterLoginStatusChange(LoginStatus login_status); |
79 | 75 |
80 // Overridden from TrayBackgroundView. | 76 // Overridden from TrayBackgroundView. |
81 void UpdateAfterShelfAlignmentChange() override; | 77 void UpdateAfterShelfAlignmentChange() override; |
82 void AnchorUpdated() override; | 78 void AnchorUpdated() override; |
83 base::string16 GetAccessibleNameForTray() override; | 79 base::string16 GetAccessibleNameForTray() override; |
84 void HideBubbleWithView(const views::TrayBubbleView* bubble_view) override; | 80 void HideBubbleWithView(const views::TrayBubbleView* bubble_view) override; |
85 void ClickedOutsideBubble() override; | 81 void ClickedOutsideBubble() override; |
86 | |
87 // Overridden from ActionableView. | |
88 bool PerformAction(const ui::Event& event) override; | 82 bool PerformAction(const ui::Event& event) override; |
| 83 void CloseBubble() override; |
| 84 void ShowBubble() override; |
| 85 views::TrayBubbleView* GetBubbleView() override; |
89 | 86 |
90 // Overridden from views::TrayBubbleView::Delegate. | 87 // Overridden from views::TrayBubbleView::Delegate. |
91 void BubbleViewDestroyed() override; | 88 void BubbleViewDestroyed() override; |
92 void OnMouseEnteredView() override; | 89 void OnMouseEnteredView() override; |
93 void OnMouseExitedView() override; | 90 void OnMouseExitedView() override; |
94 void RegisterAccelerators(const std::vector<ui::Accelerator>& accelerators, | 91 void RegisterAccelerators(const std::vector<ui::Accelerator>& accelerators, |
95 views::TrayBubbleView* tray_bubble_view) override; | 92 views::TrayBubbleView* tray_bubble_view) override; |
96 void UnregisterAllAccelerators( | 93 void UnregisterAllAccelerators( |
97 views::TrayBubbleView* tray_bubble_view) override; | 94 views::TrayBubbleView* tray_bubble_view) override; |
98 base::string16 GetAccessibleNameForBubble() override; | 95 base::string16 GetAccessibleNameForBubble() override; |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 bool should_block_shelf_auto_hide_; | 177 bool should_block_shelf_auto_hide_; |
181 | 178 |
182 std::unique_ptr<AshPopupAlignmentDelegate> popup_alignment_delegate_; | 179 std::unique_ptr<AshPopupAlignmentDelegate> popup_alignment_delegate_; |
183 | 180 |
184 DISALLOW_COPY_AND_ASSIGN(WebNotificationTray); | 181 DISALLOW_COPY_AND_ASSIGN(WebNotificationTray); |
185 }; | 182 }; |
186 | 183 |
187 } // namespace ash | 184 } // namespace ash |
188 | 185 |
189 #endif // ASH_SYSTEM_WEB_NOTIFICATION_WEB_NOTIFICATION_TRAY_H_ | 186 #endif // ASH_SYSTEM_WEB_NOTIFICATION_WEB_NOTIFICATION_TRAY_H_ |
OLD | NEW |