| Index: cc/input/scrollbar_animation_controller.cc
|
| diff --git a/cc/input/scrollbar_animation_controller.cc b/cc/input/scrollbar_animation_controller.cc
|
| index 576ec2a4318ce93d1955db96d7a206c844e5b54b..08bb917242a78c0b0c3a736dc4592fb87e681005 100644
|
| --- a/cc/input/scrollbar_animation_controller.cc
|
| +++ b/cc/input/scrollbar_animation_controller.cc
|
| @@ -53,7 +53,6 @@ ScrollbarAnimationController::ScrollbarAnimationController(
|
| scroll_gesture_has_scrolled_(false),
|
| opacity_(0.0f),
|
| fade_out_duration_(fade_out_duration),
|
| - show_scrollbars_on_scroll_gesture_(false),
|
| need_thinning_animation_(false),
|
| weak_factory_(this) {
|
| ApplyOpacityToScrollbars(0.0f);
|
| @@ -78,7 +77,6 @@ ScrollbarAnimationController::ScrollbarAnimationController(
|
| scroll_gesture_has_scrolled_(false),
|
| opacity_(0.0f),
|
| fade_out_duration_(fade_out_duration),
|
| - show_scrollbars_on_scroll_gesture_(true),
|
| need_thinning_animation_(true),
|
| weak_factory_(this) {
|
| vertical_controller_ = SingleScrollbarAnimationControllerThinning::Create(
|
| @@ -168,32 +166,17 @@ float ScrollbarAnimationController::AnimationProgressAtTime(
|
| return std::max(std::min(progress, 1.f), 0.f);
|
| }
|
|
|
| -void ScrollbarAnimationController::RunAnimationFrame(float progress) {
|
| - ApplyOpacityToScrollbars(1.f - progress);
|
| - if (progress == 1.f)
|
| - StopAnimation();
|
| -}
|
| -
|
| 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_ && MouseIsNearAnyScrollbar())
|
| - return;
|
| -
|
| - if (has_scrolled)
|
| - PostDelayedFadeOut(false);
|
| +void ScrollbarAnimationController::RunAnimationFrame(float progress) {
|
| + ApplyOpacityToScrollbars(1.f - progress);
|
| + if (progress == 1.f)
|
| + StopAnimation();
|
| }
|
|
|
| -void ScrollbarAnimationController::DidScrollUpdate() {
|
| +void ScrollbarAnimationController::DidScrollUpdate(bool on_resize) {
|
| if (need_thinning_animation_ && Captured())
|
| return;
|
|
|
| @@ -205,7 +188,7 @@ void ScrollbarAnimationController::DidScrollUpdate() {
|
| // We don't fade out scrollbar if they need thinning animation and mouse is
|
| // near.
|
| if (!need_thinning_animation_ || !MouseIsNearAnyScrollbar())
|
| - PostDelayedFadeOut(false);
|
| + PostDelayedFadeOut(on_resize);
|
| } else {
|
| scroll_gesture_has_scrolled_ = true;
|
| }
|
| @@ -218,17 +201,19 @@ void ScrollbarAnimationController::DidScrollUpdate() {
|
| }
|
| }
|
|
|
| -void ScrollbarAnimationController::WillUpdateScroll() {
|
| - if (show_scrollbars_on_scroll_gesture_)
|
| - DidScrollUpdate();
|
| -}
|
| +void ScrollbarAnimationController::DidScrollEnd() {
|
| + bool has_scrolled = scroll_gesture_has_scrolled_;
|
| + scroll_gesture_has_scrolled_ = false;
|
|
|
| -void ScrollbarAnimationController::DidResize() {
|
| - StopAnimation();
|
| - Show();
|
| - // 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_);
|
| + currently_scrolling_ = false;
|
| +
|
| + // We don't fade out scrollbar if they need thinning animation and mouse is
|
| + // near.
|
| + if (need_thinning_animation_ && MouseIsNearAnyScrollbar())
|
| + return;
|
| +
|
| + if (has_scrolled)
|
| + PostDelayedFadeOut(false);
|
| }
|
|
|
| void ScrollbarAnimationController::DidMouseDown() {
|
|
|