| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 UI_VIEWS_ANIMATION_SCROLL_ANIMATOR_H_ | 5 #ifndef UI_VIEWS_ANIMATION_SCROLL_ANIMATOR_H_ |
| 6 #define UI_VIEWS_ANIMATION_SCROLL_ANIMATOR_H_ | 6 #define UI_VIEWS_ANIMATION_SCROLL_ANIMATOR_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "ui/gfx/animation/animation_delegate.h" | 10 #include "ui/gfx/animation/animation_delegate.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 // Use this if you would prefer different acceleration than the default. | 34 // Use this if you would prefer different acceleration than the default. |
| 35 void set_acceleration(float acceleration) { acceleration_ = acceleration; } | 35 void set_acceleration(float acceleration) { acceleration_ = acceleration; } |
| 36 | 36 |
| 37 void Start(float velocity_x, float velocity_y); | 37 void Start(float velocity_x, float velocity_y); |
| 38 void Stop(); | 38 void Stop(); |
| 39 | 39 |
| 40 bool is_scrolling() const { return !!animation_.get(); } | 40 bool is_scrolling() const { return !!animation_.get(); } |
| 41 | 41 |
| 42 private: | 42 private: |
| 43 // Implementation of gfx::AnimationDelegate. | 43 // Implementation of gfx::AnimationDelegate. |
| 44 virtual void AnimationEnded(const gfx::Animation* animation) OVERRIDE; | 44 virtual void AnimationEnded(const gfx::Animation* animation) override; |
| 45 virtual void AnimationProgressed(const gfx::Animation* animation) OVERRIDE; | 45 virtual void AnimationProgressed(const gfx::Animation* animation) override; |
| 46 virtual void AnimationCanceled(const gfx::Animation* animation) OVERRIDE; | 46 virtual void AnimationCanceled(const gfx::Animation* animation) override; |
| 47 | 47 |
| 48 ScrollDelegate* delegate_; | 48 ScrollDelegate* delegate_; |
| 49 | 49 |
| 50 float velocity_x_; | 50 float velocity_x_; |
| 51 float velocity_y_; | 51 float velocity_y_; |
| 52 float last_t_; | 52 float last_t_; |
| 53 float duration_; | 53 float duration_; |
| 54 float acceleration_; | 54 float acceleration_; |
| 55 | 55 |
| 56 scoped_ptr<gfx::SlideAnimation> animation_; | 56 scoped_ptr<gfx::SlideAnimation> animation_; |
| 57 | 57 |
| 58 DISALLOW_COPY_AND_ASSIGN(ScrollAnimator); | 58 DISALLOW_COPY_AND_ASSIGN(ScrollAnimator); |
| 59 }; | 59 }; |
| 60 | 60 |
| 61 } // namespace views | 61 } // namespace views |
| 62 | 62 |
| 63 #endif // UI_VIEWS_ANIMATION_SCROLL_ANIMATOR_H_ | 63 #endif // UI_VIEWS_ANIMATION_SCROLL_ANIMATOR_H_ |
| OLD | NEW |