Chromium Code Reviews| Index: ui/message_center/views/message_list_view.h |
| diff --git a/ui/message_center/views/message_list_view.h b/ui/message_center/views/message_list_view.h |
| index 1104b47cfebbfd94cf7d338000e95f9da34ae4fd..9996c0ef33fbb3f0fbb0111878d434d1835da107 100644 |
| --- a/ui/message_center/views/message_list_view.h |
| +++ b/ui/message_center/views/message_list_view.h |
| @@ -17,6 +17,7 @@ |
| #include "ui/message_center/notification.h" |
| #include "ui/views/animation/bounds_animator.h" |
| #include "ui/views/animation/bounds_animator_observer.h" |
| +#include "ui/views/controls/scroll_view.h" |
|
Eliot Courtney
2017/04/12 06:16:18
Maybe it's possible to forward declare ScrollView
yoshiki
2017/04/14 04:37:06
Accoring to the style guide, we should include hea
|
| #include "ui/views/view.h" |
| namespace ui { |
| @@ -55,6 +56,8 @@ class MESSAGE_CENTER_EXPORT MessageListView |
| void SetRepositionTargetForTest( |
| const gfx::Rect& target_rect); |
| + void set_scroller(views::ScrollView* scroller) { scroller_ = scroller; } |
| + |
| protected: |
| // Overridden from views::View. |
| void Layout() override; |
| @@ -77,9 +80,9 @@ class MESSAGE_CENTER_EXPORT MessageListView |
| // Animates all notifications below target upwards to align with the top of |
| // the last closed notification. |
| void AnimateNotificationsBelowTarget(); |
| - // Animates all notifications above target downwards to align with the top of |
| - // the last closed notification. |
| - void AnimateNotificationsAboveTarget(); |
| + // Animates all notifications to align with the top of the last closed |
| + // notification. |
| + void AnimateNotifications(); |
| // Computes reposition offsets for |AnimateNotificationsAboveTarget|. |
| std::vector<int> ComputeRepositionOffsets(const std::vector<int>& heights, |
| const std::vector<bool>& deleting, |
| @@ -93,6 +96,10 @@ class MESSAGE_CENTER_EXPORT MessageListView |
| int height, |
| bool animate_even_on_move); |
| + // Calculate the new fixed height and update with it. |requested_height| |
| + // is the minimum height, and actual fixed height should be more than it. |
| + void UpdateFixedHeight(int requested_height, bool prevent_scroll); |
| + |
| // Animate clearing one notification. |
| void AnimateClearingOneNotification(); |
| @@ -100,19 +107,22 @@ class MESSAGE_CENTER_EXPORT MessageListView |
| base::ObserverList<Observer> observers_; |
| // The top position of the reposition target rectangle. |
| - int reposition_top_; |
| - int fixed_height_; |
| - bool has_deferred_task_; |
| - bool clear_all_started_; |
| + int reposition_top_ = -1; |
| + int fixed_height_ = 0; |
| + bool has_deferred_task_ = false; |
| + bool has_deferred_reset_ = false; |
| + bool clear_all_started_ = false; |
| std::set<views::View*> adding_views_; |
| std::set<views::View*> deleting_views_; |
| std::set<views::View*> deleted_when_done_; |
| std::list<views::View*> clearing_all_views_; |
| views::BoundsAnimator animator_; |
| + views::ScrollView* scroller_ = nullptr; |
| + |
| // If true, the message loop will be quitted after the animation finishes. |
| // This is just for tests and has no setter. |
| - bool quit_message_loop_after_animation_for_test_; |
| + bool quit_message_loop_after_animation_for_test_ = false; |
| base::WeakPtrFactory<MessageListView> weak_ptr_factory_; |
| DISALLOW_COPY_AND_ASSIGN(MessageListView); |