| Index: cc/animation/scrollbar_animation_controller.cc
|
| diff --git a/cc/animation/scrollbar_animation_controller.cc b/cc/animation/scrollbar_animation_controller.cc
|
| index 910a7d8c1398be740afbd0971f7220f05ca36eda..ffb22870825618a4a9e6e4bff1b58c5eeebb0c1e 100644
|
| --- a/cc/animation/scrollbar_animation_controller.cc
|
| +++ b/cc/animation/scrollbar_animation_controller.cc
|
| @@ -13,9 +13,11 @@ namespace cc {
|
| ScrollbarAnimationController::ScrollbarAnimationController(
|
| ScrollbarAnimationControllerClient* client,
|
| base::TimeDelta delay_before_starting,
|
| + base::TimeDelta resize_delay_before_starting,
|
| base::TimeDelta duration)
|
| : client_(client),
|
| delay_before_starting_(delay_before_starting),
|
| + resize_delay_before_starting_(resize_delay_before_starting),
|
| duration_(duration),
|
| is_animating_(false),
|
| currently_scrolling_(false),
|
| @@ -53,33 +55,34 @@ void ScrollbarAnimationController::DidScrollBegin() {
|
| currently_scrolling_ = true;
|
| }
|
|
|
| -void ScrollbarAnimationController::DidScrollUpdate() {
|
| +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.
|
| if (!currently_scrolling_)
|
| - PostDelayedFade();
|
| + PostDelayedFade(on_resize);
|
| else
|
| scroll_gesture_has_scrolled_ = true;
|
| }
|
|
|
| void ScrollbarAnimationController::DidScrollEnd() {
|
| if (scroll_gesture_has_scrolled_) {
|
| - PostDelayedFade();
|
| + PostDelayedFade(false);
|
| scroll_gesture_has_scrolled_ = false;
|
| }
|
|
|
| currently_scrolling_ = false;
|
| }
|
|
|
| -void ScrollbarAnimationController::PostDelayedFade() {
|
| +void ScrollbarAnimationController::PostDelayedFade(bool on_resize) {
|
| + base::TimeDelta delay =
|
| + on_resize ? resize_delay_before_starting_ : delay_before_starting_;
|
| delayed_scrollbar_fade_.Reset(
|
| base::Bind(&ScrollbarAnimationController::StartAnimation,
|
| weak_factory_.GetWeakPtr()));
|
| - client_->PostDelayedScrollbarFade(delayed_scrollbar_fade_.callback(),
|
| - delay_before_starting_);
|
| + client_->PostDelayedScrollbarFade(delayed_scrollbar_fade_.callback(), delay);
|
| }
|
|
|
| void ScrollbarAnimationController::StartAnimation() {
|
|
|