Chromium Code Reviews| Index: cc/input/scrollbar_animation_controller_thinning.cc |
| diff --git a/cc/input/scrollbar_animation_controller_thinning.cc b/cc/input/scrollbar_animation_controller_thinning.cc |
| index 2006d98fddb44a0779c850a7be0c32edb12c5d1c..c13876e4bc7cd65188cb548d833366df54202106 100644 |
| --- a/cc/input/scrollbar_animation_controller_thinning.cc |
| +++ b/cc/input/scrollbar_animation_controller_thinning.cc |
| @@ -72,7 +72,9 @@ void ScrollbarAnimationControllerThinning::RunAnimationFrame(float progress) { |
| if (current_animating_property_ == THICKNESS) { |
| thickness_change_ = NONE; |
| SetCurrentAnimatingProperty(OPACITY); |
| - PostDelayedAnimationTask(false); |
| + if (!mouse_is_near_scrollbar_) { |
|
aelias_OOO_until_Jul13
2016/12/07 22:35:09
nit: no braces for this in Chromium style
|
| + PostDelayedAnimationTask(false); |
| + } |
| } |
| } |
| } |
| @@ -107,7 +109,6 @@ void ScrollbarAnimationControllerThinning::DidMouseUp() { |
| StartAnimation(); |
| } else { |
| SetCurrentAnimatingProperty(OPACITY); |
| - PostDelayedAnimationTask(false); |
| } |
| } |
| @@ -135,6 +136,18 @@ void ScrollbarAnimationControllerThinning::DidScrollUpdate(bool on_resize) { |
| ApplyThumbThicknessScale(mouse_is_near_scrollbar_ ? 1.f |
| : kIdleThicknessScale); |
| SetCurrentAnimatingProperty(OPACITY); |
| + |
| + // Don't fade out the scrollbar when mouse is near. |
| + if (mouse_is_near_scrollbar_) |
| + StopAnimation(); |
| +} |
| + |
| +void ScrollbarAnimationControllerThinning::DidScrollEnd() { |
| + ScrollbarAnimationController::DidScrollEnd(); |
| + |
| + // Don't fade out the scrollbar when mouse is near. |
| + if (mouse_is_near_scrollbar_) |
| + StopAnimation(); |
| } |
| void ScrollbarAnimationControllerThinning::DidMouseMoveNear(float distance) { |