| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "cc/input/scrollbar_animation_controller.h" | 5 #include "cc/input/scrollbar_animation_controller.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/time/time.h" | 9 #include "base/time/time.h" |
| 10 #include "cc/trees/layer_tree_impl.h" | 10 #include "cc/trees/layer_tree_impl.h" |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 if (!mouse_is_near_any_scrollbar()) | 118 if (!mouse_is_near_any_scrollbar()) |
| 119 PostDelayedAnimationTask(false); | 119 PostDelayedAnimationTask(false); |
| 120 } | 120 } |
| 121 | 121 |
| 122 void ScrollbarAnimationController::DidMouseLeave() { | 122 void ScrollbarAnimationController::DidMouseLeave() { |
| 123 if (!NeedThinningAnimation()) | 123 if (!NeedThinningAnimation()) |
| 124 return; | 124 return; |
| 125 | 125 |
| 126 vertical_controller_->DidMouseLeave(); | 126 vertical_controller_->DidMouseLeave(); |
| 127 horizontal_controller_->DidMouseLeave(); | 127 horizontal_controller_->DidMouseLeave(); |
| 128 |
| 129 if (ScrollbarsHidden() || Captured()) |
| 130 return; |
| 131 |
| 132 PostDelayedAnimationTask(false); |
| 128 } | 133 } |
| 129 | 134 |
| 130 void ScrollbarAnimationController::DidMouseMoveNear( | 135 void ScrollbarAnimationController::DidMouseMoveNear( |
| 131 ScrollbarOrientation orientation, | 136 ScrollbarOrientation orientation, |
| 132 float distance) { | 137 float distance) { |
| 133 if (!NeedThinningAnimation()) | 138 if (!NeedThinningAnimation()) |
| 134 return; | 139 return; |
| 135 | 140 |
| 136 GetScrollbarAnimationController(orientation).DidMouseMoveNear(distance); | 141 GetScrollbarAnimationController(orientation).DidMouseMoveNear(distance); |
| 137 | 142 |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 return client_->ScrollbarsFor(scroll_layer_id_); | 200 return client_->ScrollbarsFor(scroll_layer_id_); |
| 196 } | 201 } |
| 197 | 202 |
| 198 void ScrollbarAnimationController::set_mouse_move_distance_for_test( | 203 void ScrollbarAnimationController::set_mouse_move_distance_for_test( |
| 199 float distance) { | 204 float distance) { |
| 200 vertical_controller_->set_mouse_move_distance_for_test(distance); | 205 vertical_controller_->set_mouse_move_distance_for_test(distance); |
| 201 horizontal_controller_->set_mouse_move_distance_for_test(distance); | 206 horizontal_controller_->set_mouse_move_distance_for_test(distance); |
| 202 } | 207 } |
| 203 | 208 |
| 204 } // namespace cc | 209 } // namespace cc |
| OLD | NEW |