Index: cc/input/scrollbar_animation_controller.cc |
diff --git a/cc/input/scrollbar_animation_controller.cc b/cc/input/scrollbar_animation_controller.cc |
index c32a1e3b278200334a585a4053f0b4c05e0cc3b8..53014f1d7893623e3a8d8d01dd39973b50857a40 100644 |
--- a/cc/input/scrollbar_animation_controller.cc |
+++ b/cc/input/scrollbar_animation_controller.cc |
@@ -169,10 +169,6 @@ float ScrollbarAnimationController::AnimationProgressAtTime( |
return std::max(std::min(progress, 1.f), 0.f); |
} |
-void ScrollbarAnimationController::DidScrollBegin() { |
- currently_scrolling_ = true; |
-} |
- |
void ScrollbarAnimationController::RunAnimationFrame(float progress) { |
ApplyOpacityToScrollbars(1.f - progress); |
client_->SetNeedsRedrawForScrollbarAnimation(); |
@@ -180,7 +176,26 @@ void ScrollbarAnimationController::RunAnimationFrame(float progress) { |
StopAnimation(); |
} |
-void ScrollbarAnimationController::DidScrollUpdate(bool on_resize) { |
+void ScrollbarAnimationController::DidScrollBegin() { |
+ currently_scrolling_ = true; |
+} |
+ |
+void ScrollbarAnimationController::DidScrollEnd() { |
+ bool has_scrolled = scroll_gesture_has_scrolled_; |
+ scroll_gesture_has_scrolled_ = false; |
+ |
+ currently_scrolling_ = false; |
+ |
+ // We don't fade out scrollbar if they need thinning animation and mouse is |
+ // near. |
+ if (need_thinning_animation_ && mouse_is_near_any_scrollbar()) |
+ return; |
+ |
+ if (has_scrolled) |
+ PostDelayedFadeOut(false); |
+} |
+ |
+void ScrollbarAnimationController::WillUpdateScroll() { |
if (need_thinning_animation_ && Captured()) |
return; |
@@ -192,7 +207,7 @@ void ScrollbarAnimationController::DidScrollUpdate(bool on_resize) { |
// We don't fade out scrollbar if they need thinning animation and mouse is |
// near. |
if (!need_thinning_animation_ || !mouse_is_near_any_scrollbar()) |
- PostDelayedFadeOut(on_resize); |
+ PostDelayedFadeOut(false); |
} else { |
scroll_gesture_has_scrolled_ = true; |
} |
@@ -205,19 +220,12 @@ void ScrollbarAnimationController::DidScrollUpdate(bool on_resize) { |
} |
} |
-void ScrollbarAnimationController::DidScrollEnd() { |
- bool has_scrolled = scroll_gesture_has_scrolled_; |
- scroll_gesture_has_scrolled_ = false; |
- |
- currently_scrolling_ = false; |
- |
- // We don't fade out scrollbar if they need thinning animation and mouse is |
- // near. |
- if (need_thinning_animation_ && mouse_is_near_any_scrollbar()) |
- return; |
- |
- if (has_scrolled) |
- PostDelayedFadeOut(false); |
+void ScrollbarAnimationController::DidResize() { |
+ StopAnimation(); |
+ FadeIn(); |
+ // We should use the gesture delay rather than the resize delay if we're in a |
+ // gesture scroll, even if it is resizing. |
+ PostDelayedFadeOut(!currently_scrolling_); |
} |
void ScrollbarAnimationController::DidMouseDown() { |