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" |
11 | 11 |
12 namespace cc { | 12 namespace cc { |
13 | 13 |
14 ScrollbarAnimationController::ScrollbarAnimationController( | 14 ScrollbarAnimationController::ScrollbarAnimationController( |
15 int scroll_layer_id, | 15 int scroll_layer_id, |
16 ScrollbarAnimationControllerClient* client, | 16 ScrollbarAnimationControllerClient* client, |
17 base::TimeDelta delay_before_starting, | 17 base::TimeDelta delay_before_starting, |
18 base::TimeDelta resize_delay_before_starting) | 18 base::TimeDelta resize_delay_before_starting) |
19 : client_(client), | 19 : client_(client), |
| 20 scroll_layer_id_(scroll_layer_id), |
20 delay_before_starting_(delay_before_starting), | 21 delay_before_starting_(delay_before_starting), |
21 resize_delay_before_starting_(resize_delay_before_starting), | 22 resize_delay_before_starting_(resize_delay_before_starting), |
22 is_animating_(false), | 23 is_animating_(false), |
23 scroll_layer_id_(scroll_layer_id), | |
24 currently_scrolling_(false), | 24 currently_scrolling_(false), |
25 scroll_gesture_has_scrolled_(false), | 25 scroll_gesture_has_scrolled_(false), |
26 weak_factory_(this) {} | 26 weak_factory_(this) {} |
27 | 27 |
28 ScrollbarAnimationController::~ScrollbarAnimationController() {} | 28 ScrollbarAnimationController::~ScrollbarAnimationController() {} |
29 | 29 |
30 bool ScrollbarAnimationController::Animate(base::TimeTicks now) { | 30 bool ScrollbarAnimationController::Animate(base::TimeTicks now) { |
31 if (!is_animating_) | 31 if (!is_animating_) |
32 return false; | 32 return false; |
33 | 33 |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 void ScrollbarAnimationController::StopAnimation() { | 93 void ScrollbarAnimationController::StopAnimation() { |
94 delayed_scrollbar_fade_.Cancel(); | 94 delayed_scrollbar_fade_.Cancel(); |
95 is_animating_ = false; | 95 is_animating_ = false; |
96 } | 96 } |
97 | 97 |
98 ScrollbarSet ScrollbarAnimationController::Scrollbars() const { | 98 ScrollbarSet ScrollbarAnimationController::Scrollbars() const { |
99 return client_->ScrollbarsFor(scroll_layer_id_); | 99 return client_->ScrollbarsFor(scroll_layer_id_); |
100 } | 100 } |
101 | 101 |
102 } // namespace cc | 102 } // namespace cc |
OLD | NEW |