| OLD | NEW |
| 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2015 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_LIST_VIEW_H_ | 5 #ifndef UI_MESSAGE_CENTER_VIEWS_MESSAGE_LIST_VIEW_H_ |
| 6 #define UI_MESSAGE_CENTER_VIEWS_MESSAGE_LIST_VIEW_H_ | 6 #define UI_MESSAGE_CENTER_VIEWS_MESSAGE_LIST_VIEW_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 #include <set> | 9 #include <set> |
| 10 | 10 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 // repositioning. | 31 // repositioning. |
| 32 class MESSAGE_CENTER_EXPORT MessageListView | 32 class MESSAGE_CENTER_EXPORT MessageListView |
| 33 : public views::View, | 33 : public views::View, |
| 34 public views::BoundsAnimatorObserver { | 34 public views::BoundsAnimatorObserver { |
| 35 public: | 35 public: |
| 36 class Observer { | 36 class Observer { |
| 37 public: | 37 public: |
| 38 virtual void OnAllNotificationsCleared() = 0; | 38 virtual void OnAllNotificationsCleared() = 0; |
| 39 }; | 39 }; |
| 40 | 40 |
| 41 explicit MessageListView(bool top_down); | 41 MessageListView(); |
| 42 ~MessageListView() override; | 42 ~MessageListView() override; |
| 43 | 43 |
| 44 void AddNotificationAt(MessageView* view, int i); | 44 void AddNotificationAt(MessageView* view, int i); |
| 45 void RemoveNotification(MessageView* view); | 45 void RemoveNotification(MessageView* view); |
| 46 void UpdateNotification(MessageView* view, const Notification& notification); | 46 void UpdateNotification(MessageView* view, const Notification& notification); |
| 47 void SetRepositionTarget(const gfx::Rect& target_rect); | 47 void SetRepositionTarget(const gfx::Rect& target_rect); |
| 48 void ResetRepositionSession(); | 48 void ResetRepositionSession(); |
| 49 void ClearAllClosableNotifications(const gfx::Rect& visible_scroll_rect); | 49 void ClearAllClosableNotifications(const gfx::Rect& visible_scroll_rect); |
| 50 | 50 |
| 51 void AddObserver(Observer* observer); | 51 void AddObserver(Observer* observer); |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 void AnimateClearingOneNotification(); | 91 void AnimateClearingOneNotification(); |
| 92 | 92 |
| 93 // List of MessageListView::Observer | 93 // List of MessageListView::Observer |
| 94 base::ObserverList<Observer> observers_; | 94 base::ObserverList<Observer> observers_; |
| 95 | 95 |
| 96 // The top position of the reposition target rectangle. | 96 // The top position of the reposition target rectangle. |
| 97 int reposition_top_; | 97 int reposition_top_; |
| 98 int fixed_height_; | 98 int fixed_height_; |
| 99 bool has_deferred_task_; | 99 bool has_deferred_task_; |
| 100 bool clear_all_started_; | 100 bool clear_all_started_; |
| 101 bool top_down_; | |
| 102 std::set<views::View*> adding_views_; | 101 std::set<views::View*> adding_views_; |
| 103 std::set<views::View*> deleting_views_; | 102 std::set<views::View*> deleting_views_; |
| 104 std::set<views::View*> deleted_when_done_; | 103 std::set<views::View*> deleted_when_done_; |
| 105 std::list<views::View*> clearing_all_views_; | 104 std::list<views::View*> clearing_all_views_; |
| 106 views::BoundsAnimator animator_; | 105 views::BoundsAnimator animator_; |
| 107 | 106 |
| 108 // If true, the message loop will be quitted after the animation finishes. | 107 // If true, the message loop will be quitted after the animation finishes. |
| 109 // This is just for tests and has no setter. | 108 // This is just for tests and has no setter. |
| 110 bool quit_message_loop_after_animation_for_test_; | 109 bool quit_message_loop_after_animation_for_test_; |
| 111 | 110 |
| 112 base::WeakPtrFactory<MessageListView> weak_ptr_factory_; | 111 base::WeakPtrFactory<MessageListView> weak_ptr_factory_; |
| 113 DISALLOW_COPY_AND_ASSIGN(MessageListView); | 112 DISALLOW_COPY_AND_ASSIGN(MessageListView); |
| 114 }; | 113 }; |
| 115 | 114 |
| 116 } // namespace message_center | 115 } // namespace message_center |
| 117 | 116 |
| 118 #endif // UI_MESSAGE_CENTER_VIEWS_MESSAGE_LIST_VIEW_H_ | 117 #endif // UI_MESSAGE_CENTER_VIEWS_MESSAGE_LIST_VIEW_H_ |
| OLD | NEW |