OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #ifndef CC_ANIMATION_SCROLLBAR_ANIMATION_CONTROLLER_THINNING_H_ | 5 #ifndef CC_ANIMATION_SCROLLBAR_ANIMATION_CONTROLLER_THINNING_H_ |
6 #define CC_ANIMATION_SCROLLBAR_ANIMATION_CONTROLLER_THINNING_H_ | 6 #define CC_ANIMATION_SCROLLBAR_ANIMATION_CONTROLLER_THINNING_H_ |
7 | 7 |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "cc/animation/scrollbar_animation_controller.h" | 9 #include "cc/animation/scrollbar_animation_controller.h" |
10 #include "cc/base/cc_export.h" | 10 #include "cc/base/cc_export.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 base::TimeDelta animation_duration); | 25 base::TimeDelta animation_duration); |
26 | 26 |
27 virtual ~ScrollbarAnimationControllerThinning(); | 27 virtual ~ScrollbarAnimationControllerThinning(); |
28 | 28 |
29 void set_mouse_move_distance_for_test(float distance) { | 29 void set_mouse_move_distance_for_test(float distance) { |
30 mouse_move_distance_to_trigger_animation_ = distance; | 30 mouse_move_distance_to_trigger_animation_ = distance; |
31 } | 31 } |
32 | 32 |
33 // ScrollbarAnimationController overrides. | 33 // ScrollbarAnimationController overrides. |
34 virtual bool IsAnimating() const OVERRIDE; | 34 virtual bool IsAnimating() const OVERRIDE; |
35 virtual base::TimeDelta DelayBeforeStart(base::TimeTicks now) const OVERRIDE; | 35 virtual base::TimeDelta DelayBeforeStart(gfx::FrameTime now) const |
| 36 OVERRIDE; |
36 | 37 |
37 virtual bool Animate(base::TimeTicks now) OVERRIDE; | 38 virtual bool Animate(gfx::FrameTime now) OVERRIDE; |
38 virtual void DidScrollGestureBegin() OVERRIDE; | 39 virtual void DidScrollGestureBegin() OVERRIDE; |
39 virtual void DidScrollGestureEnd(base::TimeTicks now) OVERRIDE; | 40 virtual void DidScrollGestureEnd(gfx::FrameTime now) OVERRIDE; |
40 virtual void DidMouseMoveOffScrollbar(base::TimeTicks now) OVERRIDE; | 41 virtual void DidMouseMoveOffScrollbar(gfx::FrameTime now) OVERRIDE; |
41 virtual bool DidScrollUpdate(base::TimeTicks now) OVERRIDE; | 42 virtual bool DidScrollUpdate(gfx::FrameTime now) OVERRIDE; |
42 virtual bool DidMouseMoveNear(base::TimeTicks now, float distance) OVERRIDE; | 43 virtual bool DidMouseMoveNear(gfx::FrameTime now, float distance) |
| 44 OVERRIDE; |
43 | 45 |
44 protected: | 46 protected: |
45 ScrollbarAnimationControllerThinning(LayerImpl* scroll_layer, | 47 ScrollbarAnimationControllerThinning(LayerImpl* scroll_layer, |
46 base::TimeDelta animation_delay, | 48 base::TimeDelta animation_delay, |
47 base::TimeDelta animation_duration); | 49 base::TimeDelta animation_duration); |
48 | 50 |
49 private: | 51 private: |
50 // Returns how far through the animation we are as a progress value from | 52 // Returns how far through the animation we are as a progress value from |
51 // 0 to 1. | 53 // 0 to 1. |
52 float AnimationProgressAtTime(base::TimeTicks now); | 54 float AnimationProgressAtTime(gfx::FrameTime now); |
53 float OpacityAtAnimationProgress(float progress); | 55 float OpacityAtAnimationProgress(float progress); |
54 float ThumbThicknessScaleAtAnimationProgress(float progress); | 56 float ThumbThicknessScaleAtAnimationProgress(float progress); |
55 void ApplyOpacityAndThumbThicknessScale(float opacity, | 57 void ApplyOpacityAndThumbThicknessScale(float opacity, |
56 float thumb_thickness_scale); | 58 float thumb_thickness_scale); |
57 | 59 |
58 LayerImpl* scroll_layer_; | 60 LayerImpl* scroll_layer_; |
59 | 61 |
60 base::TimeTicks last_awaken_time_; | 62 gfx::FrameTime last_awaken_time_; |
61 bool scroll_gesture_in_progress_; | 63 bool scroll_gesture_in_progress_; |
62 bool mouse_is_over_scrollbar_; | 64 bool mouse_is_over_scrollbar_; |
63 | 65 |
64 base::TimeDelta animation_delay_; | 66 base::TimeDelta animation_delay_; |
65 base::TimeDelta animation_duration_; | 67 base::TimeDelta animation_duration_; |
66 float mouse_move_distance_to_trigger_animation_; | 68 float mouse_move_distance_to_trigger_animation_; |
67 | 69 |
68 DISALLOW_COPY_AND_ASSIGN(ScrollbarAnimationControllerThinning); | 70 DISALLOW_COPY_AND_ASSIGN(ScrollbarAnimationControllerThinning); |
69 }; | 71 }; |
70 | 72 |
71 } // namespace cc | 73 } // namespace cc |
72 | 74 |
73 #endif // CC_ANIMATION_SCROLLBAR_ANIMATION_CONTROLLER_THINNING_H_ | 75 #endif // CC_ANIMATION_SCROLLBAR_ANIMATION_CONTROLLER_THINNING_H_ |
OLD | NEW |