| 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 <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <list> | 10 #include <list> |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 MessagePopupCollection(gfx::NativeView parent, | 60 MessagePopupCollection(gfx::NativeView parent, |
| 61 MessageCenter* message_center, | 61 MessageCenter* message_center, |
| 62 MessageCenterTray* tray, | 62 MessageCenterTray* tray, |
| 63 PopupAlignmentDelegate* alignment_delegate); | 63 PopupAlignmentDelegate* alignment_delegate); |
| 64 ~MessagePopupCollection() override; | 64 ~MessagePopupCollection() override; |
| 65 | 65 |
| 66 // Overridden from MessageCenterController: | 66 // Overridden from MessageCenterController: |
| 67 void ClickOnNotification(const std::string& notification_id) override; | 67 void ClickOnNotification(const std::string& notification_id) override; |
| 68 void RemoveNotification(const std::string& notification_id, | 68 void RemoveNotification(const std::string& notification_id, |
| 69 bool by_user) override; | 69 bool by_user) override; |
| 70 scoped_ptr<ui::MenuModel> CreateMenuModel( | 70 std::unique_ptr<ui::MenuModel> CreateMenuModel( |
| 71 const NotifierId& notifier_id, | 71 const NotifierId& notifier_id, |
| 72 const base::string16& display_source) override; | 72 const base::string16& display_source) override; |
| 73 bool HasClickedListener(const std::string& notification_id) override; | 73 bool HasClickedListener(const std::string& notification_id) override; |
| 74 void ClickOnNotificationButton(const std::string& notification_id, | 74 void ClickOnNotificationButton(const std::string& notification_id, |
| 75 int button_index) override; | 75 int button_index) override; |
| 76 void ClickOnSettingsButton(const std::string& notification_id) override; | 76 void ClickOnSettingsButton(const std::string& notification_id) override; |
| 77 | 77 |
| 78 void MarkAllPopupsShown(); | 78 void MarkAllPopupsShown(); |
| 79 | 79 |
| 80 // Since these events are really coming from individual toast widgets, | 80 // Since these events are really coming from individual toast widgets, |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 | 161 |
| 162 // This is only used to compare with incoming events, do not assume that | 162 // This is only used to compare with incoming events, do not assume that |
| 163 // the toast will be valid if this pointer is non-NULL. | 163 // the toast will be valid if this pointer is non-NULL. |
| 164 ToastContentsView* latest_toast_entered_; | 164 ToastContentsView* latest_toast_entered_; |
| 165 | 165 |
| 166 // Denotes a mode when user is clicking the Close button of toasts in a | 166 // Denotes a mode when user is clicking the Close button of toasts in a |
| 167 // sequence, w/o moving the mouse. We reposition the toasts so the next one | 167 // sequence, w/o moving the mouse. We reposition the toasts so the next one |
| 168 // happens to be right under the mouse, and the user can just dispose of | 168 // happens to be right under the mouse, and the user can just dispose of |
| 169 // multipel toasts by clicking. The mode ends when defer_timer_ expires. | 169 // multipel toasts by clicking. The mode ends when defer_timer_ expires. |
| 170 bool user_is_closing_toasts_by_clicking_; | 170 bool user_is_closing_toasts_by_clicking_; |
| 171 scoped_ptr<base::OneShotTimer> defer_timer_; | 171 std::unique_ptr<base::OneShotTimer> defer_timer_; |
| 172 // The top edge to align the position of the next toast during 'close by | 172 // The top edge to align the position of the next toast during 'close by |
| 173 // clicking" mode. | 173 // clicking" mode. |
| 174 // Only to be used when user_is_closing_toasts_by_clicking_ is true. | 174 // Only to be used when user_is_closing_toasts_by_clicking_ is true. |
| 175 int target_top_edge_; | 175 int target_top_edge_; |
| 176 | 176 |
| 177 // Weak, only exists temporarily in tests. | 177 // Weak, only exists temporarily in tests. |
| 178 scoped_ptr<base::RunLoop> run_loop_for_test_; | 178 std::unique_ptr<base::RunLoop> run_loop_for_test_; |
| 179 | 179 |
| 180 scoped_ptr<MessageViewContextMenuController> context_menu_controller_; | 180 std::unique_ptr<MessageViewContextMenuController> context_menu_controller_; |
| 181 | 181 |
| 182 // Gives out weak pointers to toast contents views which have an unrelated | 182 // Gives out weak pointers to toast contents views which have an unrelated |
| 183 // lifetime. Must remain the last member variable. | 183 // lifetime. Must remain the last member variable. |
| 184 base::WeakPtrFactory<MessagePopupCollection> weak_factory_; | 184 base::WeakPtrFactory<MessagePopupCollection> weak_factory_; |
| 185 | 185 |
| 186 DISALLOW_COPY_AND_ASSIGN(MessagePopupCollection); | 186 DISALLOW_COPY_AND_ASSIGN(MessagePopupCollection); |
| 187 }; | 187 }; |
| 188 | 188 |
| 189 } // namespace message_center | 189 } // namespace message_center |
| 190 | 190 |
| 191 #endif // UI_MESSAGE_CENTER_VIEWS_MESSAGE_POPUP_COLLECTION_H_ | 191 #endif // UI_MESSAGE_CENTER_VIEWS_MESSAGE_POPUP_COLLECTION_H_ |
| OLD | NEW |