OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 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 | 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 UI_MESSAGE_CENTER_VIEWS_MESSAGE_POPUP_COLLECTION_H_ | 5 #ifndef UI_MESSAGE_CENTER_VIEWS_MESSAGE_POPUP_COLLECTION_H_ |
6 #define UI_MESSAGE_CENTER_VIEWS_MESSAGE_POPUP_COLLECTION_H_ | 6 #define UI_MESSAGE_CENTER_VIEWS_MESSAGE_POPUP_COLLECTION_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 #include <map> | 9 #include <map> |
10 | 10 |
(...skipping 24 matching lines...) Expand all Loading... |
35 FORWARD_DECLARE_TEST(WebNotificationTrayTest, ManyPopupNotifications); | 35 FORWARD_DECLARE_TEST(WebNotificationTrayTest, ManyPopupNotifications); |
36 } | 36 } |
37 | 37 |
38 namespace message_center { | 38 namespace message_center { |
39 namespace test { | 39 namespace test { |
40 class MessagePopupCollectionTest; | 40 class MessagePopupCollectionTest; |
41 } | 41 } |
42 | 42 |
43 class MessageCenter; | 43 class MessageCenter; |
44 class MessageCenterTray; | 44 class MessageCenterTray; |
| 45 class MessageViewContextMenuController; |
45 | 46 |
46 enum PopupAlignment { | 47 enum PopupAlignment { |
47 POPUP_ALIGNMENT_TOP = 1 << 0, | 48 POPUP_ALIGNMENT_TOP = 1 << 0, |
48 POPUP_ALIGNMENT_LEFT = 1 << 1, | 49 POPUP_ALIGNMENT_LEFT = 1 << 1, |
49 POPUP_ALIGNMENT_BOTTOM = 1 << 2, | 50 POPUP_ALIGNMENT_BOTTOM = 1 << 2, |
50 POPUP_ALIGNMENT_RIGHT = 1 << 3, | 51 POPUP_ALIGNMENT_RIGHT = 1 << 3, |
51 }; | 52 }; |
52 | 53 |
53 // Container for popup toasts. Because each toast is a frameless window rather | 54 // Container for popup toasts. Because each toast is a frameless window rather |
54 // than a view in a bubble, now the container just manages all of those toasts. | 55 // than a view in a bubble, now the container just manages all of those toasts. |
(...skipping 12 matching lines...) Expand all Loading... |
67 MessagePopupCollection(gfx::NativeView parent, | 68 MessagePopupCollection(gfx::NativeView parent, |
68 MessageCenter* message_center, | 69 MessageCenter* message_center, |
69 MessageCenterTray* tray, | 70 MessageCenterTray* tray, |
70 bool first_item_has_no_margin); | 71 bool first_item_has_no_margin); |
71 virtual ~MessagePopupCollection(); | 72 virtual ~MessagePopupCollection(); |
72 | 73 |
73 // Overridden from MessageCenterController: | 74 // Overridden from MessageCenterController: |
74 virtual void ClickOnNotification(const std::string& notification_id) OVERRIDE; | 75 virtual void ClickOnNotification(const std::string& notification_id) OVERRIDE; |
75 virtual void RemoveNotification(const std::string& notification_id, | 76 virtual void RemoveNotification(const std::string& notification_id, |
76 bool by_user) OVERRIDE; | 77 bool by_user) OVERRIDE; |
77 virtual void DisableNotificationsFromThisSource( | 78 virtual scoped_ptr<ui::MenuModel> CreateMenuModel( |
78 const NotifierId& notifier_id) OVERRIDE; | 79 const NotifierId& notifier_id, |
79 virtual void ShowNotifierSettingsBubble() OVERRIDE; | 80 const base::string16& display_source) OVERRIDE; |
80 virtual bool HasClickedListener(const std::string& notification_id) OVERRIDE; | 81 virtual bool HasClickedListener(const std::string& notification_id) OVERRIDE; |
81 virtual void ClickOnNotificationButton(const std::string& notification_id, | 82 virtual void ClickOnNotificationButton(const std::string& notification_id, |
82 int button_index) OVERRIDE; | 83 int button_index) OVERRIDE; |
83 virtual void ExpandNotification(const std::string& notification_id) OVERRIDE; | 84 virtual void ExpandNotification(const std::string& notification_id) OVERRIDE; |
84 virtual void GroupBodyClicked(const std::string& last_notification_id) | 85 virtual void GroupBodyClicked(const std::string& last_notification_id) |
85 OVERRIDE; | 86 OVERRIDE; |
86 virtual void ExpandGroup(const NotifierId& notifier_id) OVERRIDE; | 87 virtual void ExpandGroup(const NotifierId& notifier_id) OVERRIDE; |
87 virtual void RemoveGroup(const NotifierId& notifier_id) OVERRIDE; | 88 virtual void RemoveGroup(const NotifierId& notifier_id) OVERRIDE; |
88 | 89 |
89 void MarkAllPopupsShown(); | 90 void MarkAllPopupsShown(); |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 // clicking" mode. | 210 // clicking" mode. |
210 // Only to be used when user_is_closing_toasts_by_clicking_ is true. | 211 // Only to be used when user_is_closing_toasts_by_clicking_ is true. |
211 int target_top_edge_; | 212 int target_top_edge_; |
212 | 213 |
213 // Weak, only exists temporarily in tests. | 214 // Weak, only exists temporarily in tests. |
214 scoped_ptr<base::RunLoop> run_loop_for_test_; | 215 scoped_ptr<base::RunLoop> run_loop_for_test_; |
215 | 216 |
216 // True if the first item should not have spacing against the tray. | 217 // True if the first item should not have spacing against the tray. |
217 bool first_item_has_no_margin_; | 218 bool first_item_has_no_margin_; |
218 | 219 |
| 220 scoped_ptr<MessageViewContextMenuController> context_menu_controller_; |
| 221 |
219 // Gives out weak pointers to toast contents views which have an unrelated | 222 // Gives out weak pointers to toast contents views which have an unrelated |
220 // lifetime. Must remain the last member variable. | 223 // lifetime. Must remain the last member variable. |
221 base::WeakPtrFactory<MessagePopupCollection> weak_factory_; | 224 base::WeakPtrFactory<MessagePopupCollection> weak_factory_; |
222 | 225 |
223 DISALLOW_COPY_AND_ASSIGN(MessagePopupCollection); | 226 DISALLOW_COPY_AND_ASSIGN(MessagePopupCollection); |
224 }; | 227 }; |
225 | 228 |
226 } // namespace message_center | 229 } // namespace message_center |
227 | 230 |
228 #endif // UI_MESSAGE_CENTER_VIEWS_MESSAGE_POPUP_COLLECTION_H_ | 231 #endif // UI_MESSAGE_CENTER_VIEWS_MESSAGE_POPUP_COLLECTION_H_ |
OLD | NEW |