| 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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 // |parent| specifies the parent widget of the toast windows. The default | 55 // |parent| specifies the parent widget of the toast windows. The default |
| 56 // parent will be used for NULL. Usually each icon is spacing against its | 56 // parent will be used for NULL. Usually each icon is spacing against its |
| 57 // predecessor. | 57 // predecessor. |
| 58 MessagePopupCollection(gfx::NativeView parent, | 58 MessagePopupCollection(gfx::NativeView parent, |
| 59 MessageCenter* message_center, | 59 MessageCenter* message_center, |
| 60 MessageCenterTray* tray, | 60 MessageCenterTray* tray, |
| 61 PopupAlignmentDelegate* alignment_delegate); | 61 PopupAlignmentDelegate* alignment_delegate); |
| 62 virtual ~MessagePopupCollection(); | 62 virtual ~MessagePopupCollection(); |
| 63 | 63 |
| 64 // Overridden from MessageCenterController: | 64 // Overridden from MessageCenterController: |
| 65 virtual void ClickOnNotification(const std::string& notification_id) OVERRIDE; | 65 virtual void ClickOnNotification(const std::string& notification_id) override; |
| 66 virtual void RemoveNotification(const std::string& notification_id, | 66 virtual void RemoveNotification(const std::string& notification_id, |
| 67 bool by_user) OVERRIDE; | 67 bool by_user) override; |
| 68 virtual scoped_ptr<ui::MenuModel> CreateMenuModel( | 68 virtual scoped_ptr<ui::MenuModel> CreateMenuModel( |
| 69 const NotifierId& notifier_id, | 69 const NotifierId& notifier_id, |
| 70 const base::string16& display_source) OVERRIDE; | 70 const base::string16& display_source) override; |
| 71 virtual bool HasClickedListener(const std::string& notification_id) OVERRIDE; | 71 virtual bool HasClickedListener(const std::string& notification_id) override; |
| 72 virtual void ClickOnNotificationButton(const std::string& notification_id, | 72 virtual void ClickOnNotificationButton(const std::string& notification_id, |
| 73 int button_index) OVERRIDE; | 73 int button_index) override; |
| 74 | 74 |
| 75 void MarkAllPopupsShown(); | 75 void MarkAllPopupsShown(); |
| 76 | 76 |
| 77 // Since these events are really coming from individual toast widgets, | 77 // Since these events are really coming from individual toast widgets, |
| 78 // it helps to be able to keep track of the sender. | 78 // it helps to be able to keep track of the sender. |
| 79 void OnMouseEntered(ToastContentsView* toast_entered); | 79 void OnMouseEntered(ToastContentsView* toast_entered); |
| 80 void OnMouseExited(ToastContentsView* toast_exited); | 80 void OnMouseExited(ToastContentsView* toast_exited); |
| 81 | 81 |
| 82 // Invoked by toasts when they start/finish their animations. | 82 // Invoked by toasts when they start/finish their animations. |
| 83 // While "defer counter" is greater then zero, the popup collection does | 83 // While "defer counter" is greater then zero, the popup collection does |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 // Repositions widgets to the top edge of the notification toast that was | 121 // Repositions widgets to the top edge of the notification toast that was |
| 122 // just removed, so that the user can click close button without mouse moves. | 122 // just removed, so that the user can click close button without mouse moves. |
| 123 // See crbug.com/224089 | 123 // See crbug.com/224089 |
| 124 void RepositionWidgetsWithTarget(); | 124 void RepositionWidgetsWithTarget(); |
| 125 | 125 |
| 126 // The base line is an (imaginary) line that would touch the bottom of the | 126 // The base line is an (imaginary) line that would touch the bottom of the |
| 127 // next created notification if bottom-aligned or its top if top-aligned. | 127 // next created notification if bottom-aligned or its top if top-aligned. |
| 128 int GetBaseLine(ToastContentsView* last_toast) const; | 128 int GetBaseLine(ToastContentsView* last_toast) const; |
| 129 | 129 |
| 130 // Overridden from MessageCenterObserver: | 130 // Overridden from MessageCenterObserver: |
| 131 virtual void OnNotificationAdded(const std::string& notification_id) OVERRIDE; | 131 virtual void OnNotificationAdded(const std::string& notification_id) override; |
| 132 virtual void OnNotificationRemoved(const std::string& notification_id, | 132 virtual void OnNotificationRemoved(const std::string& notification_id, |
| 133 bool by_user) OVERRIDE; | 133 bool by_user) override; |
| 134 virtual void OnNotificationUpdated( | 134 virtual void OnNotificationUpdated( |
| 135 const std::string& notification_id) OVERRIDE; | 135 const std::string& notification_id) override; |
| 136 | 136 |
| 137 ToastContentsView* FindToast(const std::string& notification_id) const; | 137 ToastContentsView* FindToast(const std::string& notification_id) const; |
| 138 | 138 |
| 139 // While the toasts are animated, avoid updating the collection, to reduce | 139 // While the toasts are animated, avoid updating the collection, to reduce |
| 140 // user confusion. Instead, update the collection when all animations are | 140 // user confusion. Instead, update the collection when all animations are |
| 141 // done. This method is run when defer counter is zero, may initiate next | 141 // done. This method is run when defer counter is zero, may initiate next |
| 142 // update/animation step. | 142 // update/animation step. |
| 143 void OnDeferTimerExpired(); | 143 void OnDeferTimerExpired(); |
| 144 | 144 |
| 145 // "ForTest" methods. | 145 // "ForTest" methods. |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 // Gives out weak pointers to toast contents views which have an unrelated | 180 // Gives out weak pointers to toast contents views which have an unrelated |
| 181 // lifetime. Must remain the last member variable. | 181 // lifetime. Must remain the last member variable. |
| 182 base::WeakPtrFactory<MessagePopupCollection> weak_factory_; | 182 base::WeakPtrFactory<MessagePopupCollection> weak_factory_; |
| 183 | 183 |
| 184 DISALLOW_COPY_AND_ASSIGN(MessagePopupCollection); | 184 DISALLOW_COPY_AND_ASSIGN(MessagePopupCollection); |
| 185 }; | 185 }; |
| 186 | 186 |
| 187 } // namespace message_center | 187 } // namespace message_center |
| 188 | 188 |
| 189 #endif // UI_MESSAGE_CENTER_VIEWS_MESSAGE_POPUP_COLLECTION_H_ | 189 #endif // UI_MESSAGE_CENTER_VIEWS_MESSAGE_POPUP_COLLECTION_H_ |
| OLD | NEW |