Chromium Code Reviews| Index: cc/input/scrollbar_animation_controller.cc |
| diff --git a/cc/input/scrollbar_animation_controller.cc b/cc/input/scrollbar_animation_controller.cc |
| index 45feb3ae2bfb0fa0e664b49d8531652de8dc0437..9fad17d4660c44bd7e158a34b902f3cd6bc26c81 100644 |
| --- a/cc/input/scrollbar_animation_controller.cc |
| +++ b/cc/input/scrollbar_animation_controller.cc |
| @@ -18,9 +18,9 @@ ScrollbarAnimationController::ScrollbarAnimationController( |
| base::TimeDelta resize_delay_before_starting, |
| base::TimeDelta duration) |
| : client_(client), |
| + duration_(duration), |
| delay_before_starting_(delay_before_starting), |
| resize_delay_before_starting_(resize_delay_before_starting), |
| - duration_(duration), |
| is_animating_(false), |
| scroll_layer_id_(scroll_layer_id), |
| currently_scrolling_(false), |
| @@ -57,10 +57,11 @@ void ScrollbarAnimationController::DidScrollBegin() { |
| void ScrollbarAnimationController::DidScrollUpdate(bool on_resize) { |
| StopAnimation(); |
| - delayed_scrollbar_fade_.Cancel(); |
| // As an optimization, we avoid spamming fade delay tasks during active fast |
| // scrolls. But if we're not within one, we need to post every scroll update. |
| + // TODO(bokan): When do we get ScrollUpdates without a ScrollBegin? This may |
|
aelias_OOO_until_Jul13
2016/10/20 23:40:51
Any kind of main-thread scroll (JS, history or ges
bokan
2016/10/21 00:32:30
Got it, thanks. Removed TODO and added a test.
|
| + // be unsupported behavior at this point. |
| if (!currently_scrolling_) |
| PostDelayedAnimationTask(on_resize); |
| else |
| @@ -94,6 +95,7 @@ void ScrollbarAnimationController::StartAnimation() { |
| } |
| void ScrollbarAnimationController::StopAnimation() { |
| + delayed_scrollbar_fade_.Cancel(); |
| is_animating_ = false; |
| } |