| 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 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 | 215 |
| 216 void ScrollbarAnimationController::DidMouseDown() { | 216 void ScrollbarAnimationController::DidMouseDown() { |
| 217 if (!need_thinning_animation_ || ScrollbarsHidden()) | 217 if (!need_thinning_animation_ || ScrollbarsHidden()) |
| 218 return; | 218 return; |
| 219 | 219 |
| 220 vertical_controller_->DidMouseDown(); | 220 vertical_controller_->DidMouseDown(); |
| 221 horizontal_controller_->DidMouseDown(); | 221 horizontal_controller_->DidMouseDown(); |
| 222 } | 222 } |
| 223 | 223 |
| 224 void ScrollbarAnimationController::DidMouseUp() { | 224 void ScrollbarAnimationController::DidMouseUp() { |
| 225 if (!need_thinning_animation_) | 225 if (!need_thinning_animation_ || !Captured()) |
| 226 return; | 226 return; |
| 227 | 227 |
| 228 vertical_controller_->DidMouseUp(); | 228 vertical_controller_->DidMouseUp(); |
| 229 horizontal_controller_->DidMouseUp(); | 229 horizontal_controller_->DidMouseUp(); |
| 230 | 230 |
| 231 if (!mouse_is_near_any_scrollbar()) | 231 if (!mouse_is_near_any_scrollbar()) |
| 232 PostDelayedFadeOut(false); | 232 PostDelayedFadeOut(false); |
| 233 } | 233 } |
| 234 | 234 |
| 235 void ScrollbarAnimationController::DidMouseLeave() { | 235 void ScrollbarAnimationController::DidMouseLeave() { |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 338 bool previouslyVisible = opacity_ > 0.0f; | 338 bool previouslyVisible = opacity_ > 0.0f; |
| 339 bool currentlyVisible = opacity > 0.0f; | 339 bool currentlyVisible = opacity > 0.0f; |
| 340 | 340 |
| 341 opacity_ = opacity; | 341 opacity_ = opacity; |
| 342 | 342 |
| 343 if (previouslyVisible != currentlyVisible) | 343 if (previouslyVisible != currentlyVisible) |
| 344 client_->DidChangeScrollbarVisibility(); | 344 client_->DidChangeScrollbarVisibility(); |
| 345 } | 345 } |
| 346 | 346 |
| 347 } // namespace cc | 347 } // namespace cc |
| OLD | NEW |