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_COMPOSITOR_FLOAT_ANIMATION_CURVE_ADAPTER_H_ | 5 #ifndef UI_COMPOSITOR_FLOAT_ANIMATION_CURVE_ADAPTER_H_ |
6 #define UI_COMPOSITOR_FLOAT_ANIMATION_CURVE_ADAPTER_H_ | 6 #define UI_COMPOSITOR_FLOAT_ANIMATION_CURVE_ADAPTER_H_ |
7 | 7 |
8 #include "base/memory/scoped_ptr.h" | 8 #include <memory> |
| 9 |
9 #include "base/time/time.h" | 10 #include "base/time/time.h" |
10 #include "cc/animation/animation_curve.h" | 11 #include "cc/animation/animation_curve.h" |
11 #include "ui/gfx/animation/tween.h" | 12 #include "ui/gfx/animation/tween.h" |
12 | 13 |
13 namespace ui { | 14 namespace ui { |
14 | 15 |
15 class FloatAnimationCurveAdapter : public cc::FloatAnimationCurve { | 16 class FloatAnimationCurveAdapter : public cc::FloatAnimationCurve { |
16 public: | 17 public: |
17 FloatAnimationCurveAdapter(gfx::Tween::Type tween_type, | 18 FloatAnimationCurveAdapter(gfx::Tween::Type tween_type, |
18 float initial_value, | 19 float initial_value, |
19 float target_value, | 20 float target_value, |
20 base::TimeDelta duration); | 21 base::TimeDelta duration); |
21 | 22 |
22 ~FloatAnimationCurveAdapter() override {} | 23 ~FloatAnimationCurveAdapter() override {} |
23 | 24 |
24 // FloatAnimationCurve implementation. | 25 // FloatAnimationCurve implementation. |
25 base::TimeDelta Duration() const override; | 26 base::TimeDelta Duration() const override; |
26 scoped_ptr<cc::AnimationCurve> Clone() const override; | 27 std::unique_ptr<cc::AnimationCurve> Clone() const override; |
27 float GetValue(base::TimeDelta t) const override; | 28 float GetValue(base::TimeDelta t) const override; |
28 | 29 |
29 private: | 30 private: |
30 gfx::Tween::Type tween_type_; | 31 gfx::Tween::Type tween_type_; |
31 float initial_value_; | 32 float initial_value_; |
32 float target_value_; | 33 float target_value_; |
33 base::TimeDelta duration_; | 34 base::TimeDelta duration_; |
34 }; | 35 }; |
35 | 36 |
36 } // namespace ui | 37 } // namespace ui |
37 | 38 |
38 #endif // UI_COMPOSITOR_FLOAT_ANIMATION_CURVE_ADAPTER_H_ | 39 #endif // UI_COMPOSITOR_FLOAT_ANIMATION_CURVE_ADAPTER_H_ |
OLD | NEW |