| 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_H_ | 5 #ifndef CC_ANIMATION_SCROLLBAR_ANIMATION_CONTROLLER_H_ |
| 6 #define CC_ANIMATION_SCROLLBAR_ANIMATION_CONTROLLER_H_ | 6 #define CC_ANIMATION_SCROLLBAR_ANIMATION_CONTROLLER_H_ |
| 7 | 7 |
| 8 #include "base/time/time.h" | 8 #include "base/time/time.h" |
| 9 #include "cc/base/cc_export.h" | 9 #include "cc/base/cc_export.h" |
| 10 #include "ui/gfx/vector2d_f.h" | 10 #include "ui/gfx/vector2d_f.h" |
| 11 #include "ui/gfx/frame_time.h" |
| 11 | 12 |
| 12 namespace cc { | 13 namespace cc { |
| 13 | 14 |
| 14 // This abstract class represents the compositor-side analogy of | 15 // This abstract class represents the compositor-side analogy of |
| 15 // ScrollbarAnimator. Individual platforms should subclass it to provide | 16 // ScrollbarAnimator. Individual platforms should subclass it to provide |
| 16 // specialized implementation. | 17 // specialized implementation. |
| 17 class CC_EXPORT ScrollbarAnimationController { | 18 class CC_EXPORT ScrollbarAnimationController { |
| 18 public: | 19 public: |
| 19 virtual ~ScrollbarAnimationController() {} | 20 virtual ~ScrollbarAnimationController() {} |
| 20 | 21 |
| 21 virtual bool IsAnimating() const = 0; | 22 virtual bool IsAnimating() const = 0; |
| 22 virtual base::TimeDelta DelayBeforeStart(base::TimeTicks now) const = 0; | 23 virtual base::TimeDelta DelayBeforeStart(gfx::FrameTime now) |
| 24 const = 0; |
| 23 | 25 |
| 24 virtual bool Animate(base::TimeTicks now) = 0; | 26 virtual bool Animate(gfx::FrameTime now) = 0; |
| 25 virtual void DidScrollGestureBegin() = 0; | 27 virtual void DidScrollGestureBegin() = 0; |
| 26 virtual void DidScrollGestureEnd(base::TimeTicks now) = 0; | 28 virtual void DidScrollGestureEnd(gfx::FrameTime now) = 0; |
| 27 virtual void DidMouseMoveOffScrollbar(base::TimeTicks now) = 0; | 29 virtual void DidMouseMoveOffScrollbar(gfx::FrameTime now) = 0; |
| 28 | 30 |
| 29 // Returns true if we should start an animation. | 31 // Returns true if we should start an animation. |
| 30 virtual bool DidScrollUpdate(base::TimeTicks now) = 0; | 32 virtual bool DidScrollUpdate(gfx::FrameTime now) = 0; |
| 31 virtual bool DidMouseMoveNear(base::TimeTicks now, float distance) = 0; | 33 virtual bool DidMouseMoveNear(gfx::FrameTime now, float distance) |
| 34 = 0; |
| 32 }; | 35 }; |
| 33 | 36 |
| 34 } // namespace cc | 37 } // namespace cc |
| 35 | 38 |
| 36 #endif // CC_ANIMATION_SCROLLBAR_ANIMATION_CONTROLLER_H_ | 39 #endif // CC_ANIMATION_SCROLLBAR_ANIMATION_CONTROLLER_H_ |
| OLD | NEW |