OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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_LINEAR_FADE_H_ | 5 #ifndef CC_ANIMATION_SCROLLBAR_ANIMATION_CONTROLLER_LINEAR_FADE_H_ |
6 #define CC_ANIMATION_SCROLLBAR_ANIMATION_CONTROLLER_LINEAR_FADE_H_ | 6 #define CC_ANIMATION_SCROLLBAR_ANIMATION_CONTROLLER_LINEAR_FADE_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" |
11 | 11 |
12 namespace cc { | 12 namespace cc { |
13 class LayerImpl; | 13 class LayerImpl; |
14 | 14 |
15 class CC_EXPORT ScrollbarAnimationControllerLinearFade | 15 class CC_EXPORT ScrollbarAnimationControllerLinearFade |
16 : public ScrollbarAnimationController { | 16 : public ScrollbarAnimationController { |
17 public: | 17 public: |
18 static scoped_ptr<ScrollbarAnimationControllerLinearFade> Create( | 18 static scoped_ptr<ScrollbarAnimationControllerLinearFade> Create( |
19 LayerImpl* scroll_layer, | 19 LayerImpl* scroll_layer, |
20 base::TimeDelta fadeout_delay, | 20 base::TimeDelta fadeout_delay, |
21 base::TimeDelta fadeout_length); | 21 base::TimeDelta fadeout_length); |
22 | 22 |
23 virtual ~ScrollbarAnimationControllerLinearFade(); | 23 virtual ~ScrollbarAnimationControllerLinearFade(); |
24 | 24 |
25 // ScrollbarAnimationController overrides. | 25 // ScrollbarAnimationController overrides. |
26 virtual bool IsAnimating() const OVERRIDE; | 26 virtual bool IsAnimating() const OVERRIDE; |
27 virtual base::TimeDelta DelayBeforeStart(base::TimeTicks now) const OVERRIDE; | 27 virtual base::TimeDelta DelayBeforeStart(gfx::FrameTime now) const |
| 28 OVERRIDE; |
28 | 29 |
29 virtual bool Animate(base::TimeTicks now) OVERRIDE; | 30 virtual bool Animate(gfx::FrameTime now) OVERRIDE; |
30 virtual void DidScrollGestureBegin() OVERRIDE; | 31 virtual void DidScrollGestureBegin() OVERRIDE; |
31 virtual void DidScrollGestureEnd(base::TimeTicks now) OVERRIDE; | 32 virtual void DidScrollGestureEnd(gfx::FrameTime now) OVERRIDE; |
32 virtual void DidMouseMoveOffScrollbar(base::TimeTicks now) OVERRIDE; | 33 virtual void DidMouseMoveOffScrollbar(gfx::FrameTime now) OVERRIDE; |
33 virtual bool DidScrollUpdate(base::TimeTicks now) OVERRIDE; | 34 virtual bool DidScrollUpdate(gfx::FrameTime now) OVERRIDE; |
34 virtual bool DidMouseMoveNear(base::TimeTicks now, float distance) OVERRIDE; | 35 virtual bool DidMouseMoveNear(gfx::FrameTime now, float distance) |
| 36 OVERRIDE; |
35 | 37 |
36 protected: | 38 protected: |
37 ScrollbarAnimationControllerLinearFade(LayerImpl* scroll_layer, | 39 ScrollbarAnimationControllerLinearFade(LayerImpl* scroll_layer, |
38 base::TimeDelta fadeout_delay, | 40 base::TimeDelta fadeout_delay, |
39 base::TimeDelta fadeout_length); | 41 base::TimeDelta fadeout_length); |
40 | 42 |
41 private: | 43 private: |
42 float OpacityAtTime(base::TimeTicks now); | 44 float OpacityAtTime(gfx::FrameTime now); |
43 void ApplyOpacityToScrollbars(float opacity); | 45 void ApplyOpacityToScrollbars(float opacity); |
44 | 46 |
45 LayerImpl* scroll_layer_; | 47 LayerImpl* scroll_layer_; |
46 | 48 |
47 base::TimeTicks last_awaken_time_; | 49 gfx::FrameTime last_awaken_time_; |
48 bool scroll_gesture_in_progress_; | 50 bool scroll_gesture_in_progress_; |
49 bool scroll_gesture_has_scrolled_; | 51 bool scroll_gesture_has_scrolled_; |
50 | 52 |
51 base::TimeDelta fadeout_delay_; | 53 base::TimeDelta fadeout_delay_; |
52 base::TimeDelta fadeout_length_; | 54 base::TimeDelta fadeout_length_; |
53 | 55 |
54 DISALLOW_COPY_AND_ASSIGN(ScrollbarAnimationControllerLinearFade); | 56 DISALLOW_COPY_AND_ASSIGN(ScrollbarAnimationControllerLinearFade); |
55 }; | 57 }; |
56 | 58 |
57 } // namespace cc | 59 } // namespace cc |
58 | 60 |
59 #endif // CC_ANIMATION_SCROLLBAR_ANIMATION_CONTROLLER_LINEAR_FADE_H_ | 61 #endif // CC_ANIMATION_SCROLLBAR_ANIMATION_CONTROLLER_LINEAR_FADE_H_ |
OLD | NEW |