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_INPUT_SCROLLBAR_ANIMATION_CONTROLLER_THINNING_H_ | 5 #ifndef CC_INPUT_SCROLLBAR_ANIMATION_CONTROLLER_THINNING_H_ |
6 #define CC_INPUT_SCROLLBAR_ANIMATION_CONTROLLER_THINNING_H_ | 6 #define CC_INPUT_SCROLLBAR_ANIMATION_CONTROLLER_THINNING_H_ |
7 | 7 |
| 8 #include <memory> |
| 9 |
8 #include "base/macros.h" | 10 #include "base/macros.h" |
9 #include "base/memory/scoped_ptr.h" | |
10 #include "cc/base/cc_export.h" | 11 #include "cc/base/cc_export.h" |
11 #include "cc/input/scrollbar_animation_controller.h" | 12 #include "cc/input/scrollbar_animation_controller.h" |
12 | 13 |
13 namespace cc { | 14 namespace cc { |
14 class LayerImpl; | 15 class LayerImpl; |
15 | 16 |
16 // Scrollbar animation that partially fades and thins after an idle delay, | 17 // Scrollbar animation that partially fades and thins after an idle delay, |
17 // and reacts to mouse movements. | 18 // and reacts to mouse movements. |
18 class CC_EXPORT ScrollbarAnimationControllerThinning | 19 class CC_EXPORT ScrollbarAnimationControllerThinning |
19 : public ScrollbarAnimationController { | 20 : public ScrollbarAnimationController { |
20 public: | 21 public: |
21 static scoped_ptr<ScrollbarAnimationControllerThinning> Create( | 22 static std::unique_ptr<ScrollbarAnimationControllerThinning> Create( |
22 int scroll_layer_id, | 23 int scroll_layer_id, |
23 ScrollbarAnimationControllerClient* client, | 24 ScrollbarAnimationControllerClient* client, |
24 base::TimeDelta delay_before_starting, | 25 base::TimeDelta delay_before_starting, |
25 base::TimeDelta resize_delay_before_starting, | 26 base::TimeDelta resize_delay_before_starting, |
26 base::TimeDelta duration); | 27 base::TimeDelta duration); |
27 | 28 |
28 ~ScrollbarAnimationControllerThinning() override; | 29 ~ScrollbarAnimationControllerThinning() override; |
29 | 30 |
30 void set_mouse_move_distance_for_test(float distance) { | 31 void set_mouse_move_distance_for_test(float distance) { |
31 mouse_move_distance_to_trigger_animation_ = distance; | 32 mouse_move_distance_to_trigger_animation_ = distance; |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 AnimationChange opacity_change_; | 68 AnimationChange opacity_change_; |
68 // How close should the mouse be to the scrollbar before we thicken it. | 69 // How close should the mouse be to the scrollbar before we thicken it. |
69 float mouse_move_distance_to_trigger_animation_; | 70 float mouse_move_distance_to_trigger_animation_; |
70 | 71 |
71 DISALLOW_COPY_AND_ASSIGN(ScrollbarAnimationControllerThinning); | 72 DISALLOW_COPY_AND_ASSIGN(ScrollbarAnimationControllerThinning); |
72 }; | 73 }; |
73 | 74 |
74 } // namespace cc | 75 } // namespace cc |
75 | 76 |
76 #endif // CC_INPUT_SCROLLBAR_ANIMATION_CONTROLLER_THINNING_H_ | 77 #endif // CC_INPUT_SCROLLBAR_ANIMATION_CONTROLLER_THINNING_H_ |
OLD | NEW |