OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_GFX_ANIMATION_ANIMATION_H_ | 5 #ifndef UI_GFX_ANIMATION_ANIMATION_H_ |
6 #define UI_GFX_ANIMATION_ANIMATION_H_ | 6 #define UI_GFX_ANIMATION_ANIMATION_H_ |
7 | 7 |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 // true the delegate is notified the animation was canceled, otherwise the | 75 // true the delegate is notified the animation was canceled, otherwise the |
76 // delegate is notified the animation stopped. | 76 // delegate is notified the animation stopped. |
77 virtual bool ShouldSendCanceledFromStop(); | 77 virtual bool ShouldSendCanceledFromStop(); |
78 | 78 |
79 AnimationContainer* container() { return container_.get(); } | 79 AnimationContainer* container() { return container_.get(); } |
80 base::TimeTicks start_time() const { return start_time_; } | 80 base::TimeTicks start_time() const { return start_time_; } |
81 AnimationDelegate* delegate() { return delegate_; } | 81 AnimationDelegate* delegate() { return delegate_; } |
82 | 82 |
83 // AnimationContainer::Element overrides | 83 // AnimationContainer::Element overrides |
84 void SetStartTime(base::TimeTicks start_time) override; | 84 void SetStartTime(base::TimeTicks start_time) override; |
85 virtual void Step(base::TimeTicks time_now) = 0; | 85 void Step(base::TimeTicks time_now) override = 0; |
86 base::TimeDelta GetTimerInterval() const override; | 86 base::TimeDelta GetTimerInterval() const override; |
87 | 87 |
88 private: | 88 private: |
89 // Interval for the animation. | 89 // Interval for the animation. |
90 const base::TimeDelta timer_interval_; | 90 const base::TimeDelta timer_interval_; |
91 | 91 |
92 // If true we're running. | 92 // If true we're running. |
93 bool is_animating_; | 93 bool is_animating_; |
94 | 94 |
95 // Our delegate; may be null. | 95 // Our delegate; may be null. |
96 AnimationDelegate* delegate_; | 96 AnimationDelegate* delegate_; |
97 | 97 |
98 // Container we're in. If non-null we're animating. | 98 // Container we're in. If non-null we're animating. |
99 scoped_refptr<AnimationContainer> container_; | 99 scoped_refptr<AnimationContainer> container_; |
100 | 100 |
101 // Time we started at. | 101 // Time we started at. |
102 base::TimeTicks start_time_; | 102 base::TimeTicks start_time_; |
103 | 103 |
104 DISALLOW_COPY_AND_ASSIGN(Animation); | 104 DISALLOW_COPY_AND_ASSIGN(Animation); |
105 }; | 105 }; |
106 | 106 |
107 } // namespace gfx | 107 } // namespace gfx |
108 | 108 |
109 #endif // UI_GFX_ANIMATION_ANIMATION_H_ | 109 #endif // UI_GFX_ANIMATION_ANIMATION_H_ |
OLD | NEW |