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 "ash/ash_export.h" | 8 #include "ash/ash_export.h" |
9 #include "ash/system/tray/tray_background_view.h" | 9 #include "ash/system/tray/tray_background_view.h" |
10 #include "ash/system/user/login_status.h" | 10 #include "ash/system/user/login_status.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 | 26 |
27 namespace views { | 27 namespace views { |
28 class ImageButton; | 28 class ImageButton; |
29 class MenuRunner; | 29 class MenuRunner; |
30 } | 30 } |
31 | 31 |
32 namespace message_center { | 32 namespace message_center { |
33 class MessageBubbleBase; | 33 class MessageBubbleBase; |
34 class MessageCenter; | 34 class MessageCenter; |
35 class MessageCenterBubble; | 35 class MessageCenterBubble; |
36 class MessagePopupBubble; | |
37 class MessagePopupCollection; | 36 class MessagePopupCollection; |
38 } | 37 } |
39 | 38 |
40 namespace ash { | 39 namespace ash { |
41 | 40 |
42 namespace internal { | 41 namespace internal { |
43 class StatusAreaWidget; | 42 class StatusAreaWidget; |
44 class WebNotificationBubbleWrapper; | 43 class WebNotificationBubbleWrapper; |
45 class WebNotificationButton; | 44 class WebNotificationButton; |
46 } | 45 } |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 | 96 |
98 // Overridden from ButtonListener. | 97 // Overridden from ButtonListener. |
99 virtual void ButtonPressed(views::Button* sender, | 98 virtual void ButtonPressed(views::Button* sender, |
100 const ui::Event& event) OVERRIDE; | 99 const ui::Event& event) OVERRIDE; |
101 | 100 |
102 // Overridden from MessageCenterTrayDelegate. | 101 // Overridden from MessageCenterTrayDelegate. |
103 virtual void OnMessageCenterTrayChanged() OVERRIDE; | 102 virtual void OnMessageCenterTrayChanged() OVERRIDE; |
104 virtual bool ShowMessageCenter() OVERRIDE; | 103 virtual bool ShowMessageCenter() OVERRIDE; |
105 virtual void HideMessageCenter() OVERRIDE; | 104 virtual void HideMessageCenter() OVERRIDE; |
106 virtual bool ShowPopups() OVERRIDE; | 105 virtual bool ShowPopups() OVERRIDE; |
107 virtual void UpdatePopups() OVERRIDE; | |
108 virtual void HidePopups() OVERRIDE; | 106 virtual void HidePopups() OVERRIDE; |
109 virtual bool ShowNotifierSettings() OVERRIDE; | 107 virtual bool ShowNotifierSettings() OVERRIDE; |
110 | 108 |
111 message_center::MessageCenter* message_center(); | 109 message_center::MessageCenter* message_center(); |
112 | 110 |
113 private: | 111 private: |
114 FRIEND_TEST_ALL_PREFIXES(WebNotificationTrayTest, WebNotifications); | 112 FRIEND_TEST_ALL_PREFIXES(WebNotificationTrayTest, WebNotifications); |
115 FRIEND_TEST_ALL_PREFIXES(WebNotificationTrayTest, WebNotificationPopupBubble); | 113 FRIEND_TEST_ALL_PREFIXES(WebNotificationTrayTest, WebNotificationPopupBubble); |
116 FRIEND_TEST_ALL_PREFIXES(WebNotificationTrayTest, | 114 FRIEND_TEST_ALL_PREFIXES(WebNotificationTrayTest, |
117 ManyMessageCenterNotifications); | 115 ManyMessageCenterNotifications); |
(...skipping 13 matching lines...) Expand all Loading... |
131 // Returns true if it should show the quiet mode menu. | 129 // Returns true if it should show the quiet mode menu. |
132 bool ShouldShowQuietModeMenu(const ui::Event& event); | 130 bool ShouldShowQuietModeMenu(const ui::Event& event); |
133 | 131 |
134 // Shows the quiet mode menu. | 132 // Shows the quiet mode menu. |
135 void ShowQuietModeMenu(const ui::Event& event); | 133 void ShowQuietModeMenu(const ui::Event& event); |
136 | 134 |
137 internal::WebNotificationBubbleWrapper* message_center_bubble() const { | 135 internal::WebNotificationBubbleWrapper* message_center_bubble() const { |
138 return message_center_bubble_.get(); | 136 return message_center_bubble_.get(); |
139 } | 137 } |
140 | 138 |
141 internal::WebNotificationBubbleWrapper* popup_bubble() const { | |
142 return popup_bubble_.get(); | |
143 } | |
144 | |
145 // Testing accessors. | 139 // Testing accessors. |
146 bool IsPopupVisible() const; | 140 bool IsPopupVisible() const; |
147 message_center::MessageCenterBubble* GetMessageCenterBubbleForTest(); | 141 message_center::MessageCenterBubble* GetMessageCenterBubbleForTest(); |
148 message_center::MessagePopupBubble* GetPopupBubbleForTest(); | |
149 | 142 |
150 scoped_ptr<message_center::MessageCenterTray> message_center_tray_; | 143 scoped_ptr<message_center::MessageCenterTray> message_center_tray_; |
151 scoped_ptr<internal::WebNotificationBubbleWrapper> message_center_bubble_; | 144 scoped_ptr<internal::WebNotificationBubbleWrapper> message_center_bubble_; |
152 scoped_ptr<internal::WebNotificationBubbleWrapper> popup_bubble_; | |
153 scoped_ptr<message_center::MessagePopupCollection> popup_collection_; | 145 scoped_ptr<message_center::MessagePopupCollection> popup_collection_; |
154 scoped_ptr<views::MenuRunner> quiet_mode_menu_runner_; | 146 scoped_ptr<views::MenuRunner> quiet_mode_menu_runner_; |
155 internal::WebNotificationButton* button_; | 147 internal::WebNotificationButton* button_; |
156 | 148 |
157 bool show_message_center_on_unlock_; | 149 bool show_message_center_on_unlock_; |
158 | 150 |
159 bool should_update_tray_content_; | 151 bool should_update_tray_content_; |
160 | 152 |
161 // True when the shelf auto hide behavior has to be blocked. Previously | 153 // True when the shelf auto hide behavior has to be blocked. Previously |
162 // this was done by checking |message_center_bubble_| but actually | 154 // this was done by checking |message_center_bubble_| but actually |
163 // the check can be called when creating this object, so it would cause | 155 // the check can be called when creating this object, so it would cause |
164 // flickers of the shelf from hidden to shown. See: crbug.com/181213 | 156 // flickers of the shelf from hidden to shown. See: crbug.com/181213 |
165 bool should_block_shelf_auto_hide_; | 157 bool should_block_shelf_auto_hide_; |
166 | 158 |
167 DISALLOW_COPY_AND_ASSIGN(WebNotificationTray); | 159 DISALLOW_COPY_AND_ASSIGN(WebNotificationTray); |
168 }; | 160 }; |
169 | 161 |
170 } // namespace ash | 162 } // namespace ash |
171 | 163 |
172 #endif // ASH_SYSTEM_WEB_NOTIFICATION_WEB_NOTIFICATION_TRAY_H_ | 164 #endif // ASH_SYSTEM_WEB_NOTIFICATION_WEB_NOTIFICATION_TRAY_H_ |
OLD | NEW |