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 13 matching lines...) Expand all Loading... |
24 base::TimeDelta duration); | 24 base::TimeDelta duration); |
25 | 25 |
26 virtual ~ScrollbarAnimationControllerThinning(); | 26 virtual ~ScrollbarAnimationControllerThinning(); |
27 | 27 |
28 void set_mouse_move_distance_for_test(float distance) { | 28 void set_mouse_move_distance_for_test(float distance) { |
29 mouse_move_distance_to_trigger_animation_ = distance; | 29 mouse_move_distance_to_trigger_animation_ = distance; |
30 } | 30 } |
31 bool mouse_is_over_scrollbar() const { return mouse_is_over_scrollbar_; } | 31 bool mouse_is_over_scrollbar() const { return mouse_is_over_scrollbar_; } |
32 bool mouse_is_near_scrollbar() const { return mouse_is_near_scrollbar_; } | 32 bool mouse_is_near_scrollbar() const { return mouse_is_near_scrollbar_; } |
33 | 33 |
34 virtual void DidScrollUpdate() OVERRIDE; | 34 virtual void DidScrollUpdate() override; |
35 virtual void DidMouseMoveOffScrollbar() OVERRIDE; | 35 virtual void DidMouseMoveOffScrollbar() override; |
36 virtual void DidMouseMoveNear(float distance) OVERRIDE; | 36 virtual void DidMouseMoveNear(float distance) override; |
37 | 37 |
38 protected: | 38 protected: |
39 ScrollbarAnimationControllerThinning( | 39 ScrollbarAnimationControllerThinning( |
40 LayerImpl* scroll_layer, | 40 LayerImpl* scroll_layer, |
41 ScrollbarAnimationControllerClient* client, | 41 ScrollbarAnimationControllerClient* client, |
42 base::TimeDelta delay_before_starting, | 42 base::TimeDelta delay_before_starting, |
43 base::TimeDelta duration); | 43 base::TimeDelta duration); |
44 | 44 |
45 virtual void RunAnimationFrame(float progress) OVERRIDE; | 45 virtual void RunAnimationFrame(float progress) override; |
46 | 46 |
47 private: | 47 private: |
48 // Describes whether the current animation should INCREASE (darken / thicken) | 48 // Describes whether the current animation should INCREASE (darken / thicken) |
49 // a bar or DECREASE it (lighten / thin). | 49 // a bar or DECREASE it (lighten / thin). |
50 enum AnimationChange { | 50 enum AnimationChange { |
51 NONE, | 51 NONE, |
52 INCREASE, | 52 INCREASE, |
53 DECREASE | 53 DECREASE |
54 }; | 54 }; |
55 float OpacityAtAnimationProgress(float progress); | 55 float OpacityAtAnimationProgress(float progress); |
(...skipping 14 matching lines...) Expand all Loading... |
70 AnimationChange opacity_change_; | 70 AnimationChange opacity_change_; |
71 // How close should the mouse be to the scrollbar before we thicken it. | 71 // How close should the mouse be to the scrollbar before we thicken it. |
72 float mouse_move_distance_to_trigger_animation_; | 72 float mouse_move_distance_to_trigger_animation_; |
73 | 73 |
74 DISALLOW_COPY_AND_ASSIGN(ScrollbarAnimationControllerThinning); | 74 DISALLOW_COPY_AND_ASSIGN(ScrollbarAnimationControllerThinning); |
75 }; | 75 }; |
76 | 76 |
77 } // namespace cc | 77 } // namespace cc |
78 | 78 |
79 #endif // CC_ANIMATION_SCROLLBAR_ANIMATION_CONTROLLER_THINNING_H_ | 79 #endif // CC_ANIMATION_SCROLLBAR_ANIMATION_CONTROLLER_THINNING_H_ |
OLD | NEW |