| 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 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 317 DCHECK(need_thinning_animation_); | 317 DCHECK(need_thinning_animation_); |
| 318 | 318 |
| 319 if (vertical_controller_->mouse_is_over_scrollbar() || | 319 if (vertical_controller_->mouse_is_over_scrollbar() || |
| 320 horizontal_controller_->mouse_is_over_scrollbar()) | 320 horizontal_controller_->mouse_is_over_scrollbar()) |
| 321 return true; | 321 return true; |
| 322 | 322 |
| 323 for (ScrollbarLayerImplBase* scrollbar : Scrollbars()) { | 323 for (ScrollbarLayerImplBase* scrollbar : Scrollbars()) { |
| 324 if (scrollbar->orientation() != orientation) | 324 if (scrollbar->orientation() != orientation) |
| 325 continue; | 325 continue; |
| 326 | 326 |
| 327 if (distance < | 327 if (distance < kMouseMoveDistanceToTriggerShow) |
| 328 (kMouseMoveDistanceToTriggerShow - scrollbar->ThumbThickness())) | |
| 329 return true; | 328 return true; |
| 330 } | 329 } |
| 331 | 330 |
| 332 return false; | 331 return false; |
| 333 } | 332 } |
| 334 | 333 |
| 335 bool ScrollbarAnimationController::MouseIsOverScrollbar( | 334 bool ScrollbarAnimationController::MouseIsOverScrollbar( |
| 336 ScrollbarOrientation orientation) const { | 335 ScrollbarOrientation orientation) const { |
| 337 DCHECK(need_thinning_animation_); | 336 DCHECK(need_thinning_animation_); |
| 338 return GetScrollbarAnimationController(orientation).mouse_is_over_scrollbar(); | 337 return GetScrollbarAnimationController(orientation).mouse_is_over_scrollbar(); |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 378 if (opacity_ != opacity) | 377 if (opacity_ != opacity) |
| 379 client_->SetNeedsRedrawForScrollbarAnimation(); | 378 client_->SetNeedsRedrawForScrollbarAnimation(); |
| 380 | 379 |
| 381 opacity_ = opacity; | 380 opacity_ = opacity; |
| 382 | 381 |
| 383 if (previouslyVisible != currentlyVisible) | 382 if (previouslyVisible != currentlyVisible) |
| 384 client_->DidChangeScrollbarVisibility(); | 383 client_->DidChangeScrollbarVisibility(); |
| 385 } | 384 } |
| 386 | 385 |
| 387 } // namespace cc | 386 } // namespace cc |
| OLD | NEW |