OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_TEST_INK_DROP_ANIMATION_TEST_API_H_ | 5 #ifndef UI_VIEWS_ANIMATION_TEST_INK_DROP_ANIMATION_TEST_API_H_ |
6 #define UI_VIEWS_ANIMATION_TEST_INK_DROP_ANIMATION_TEST_API_H_ | 6 #define UI_VIEWS_ANIMATION_TEST_INK_DROP_ANIMATION_TEST_API_H_ |
7 | 7 |
| 8 #include <vector> |
| 9 |
8 #include "base/macros.h" | 10 #include "base/macros.h" |
9 #include "ui/gfx/geometry/size.h" | 11 #include "ui/gfx/geometry/size.h" |
10 | 12 |
| 13 namespace ui { |
| 14 class LayerAnimator; |
| 15 } // namespace ui |
| 16 |
11 namespace views { | 17 namespace views { |
12 class InkDropAnimation; | 18 class InkDropAnimation; |
13 | 19 |
14 namespace test { | 20 namespace test { |
15 | 21 |
16 // Test API to provide internal access to an InkDropAnimation. | 22 // Test API to provide internal access to an InkDropAnimation. |
17 class InkDropAnimationTestApi { | 23 class InkDropAnimationTestApi { |
18 public: | 24 public: |
19 typedef InkDropAnimation::InkDropTransforms InkDropTransforms; | 25 typedef InkDropAnimation::InkDropTransforms InkDropTransforms; |
20 typedef InkDropAnimation::PaintedShape PaintedShape; | 26 typedef InkDropAnimation::PaintedShape PaintedShape; |
21 | 27 |
22 explicit InkDropAnimationTestApi(InkDropAnimation* ink_drop_animation); | 28 explicit InkDropAnimationTestApi(InkDropAnimation* ink_drop_animation); |
23 ~InkDropAnimationTestApi(); | 29 ~InkDropAnimationTestApi(); |
24 | 30 |
| 31 // Disables the animation timers when |disable_timers| is true. This |
| 32 void SetDisableAnimationTimers(bool disable_timers); |
| 33 |
| 34 // Returns true if any animations are active. |
| 35 bool HasActiveAnimations() const; |
| 36 |
| 37 // Completes all animations for all the Layer's owned by the InkDropAnimation. |
| 38 void CompleteAnimations(); |
| 39 |
25 // Wrapper functions the wrapped InkDropedAnimation: | 40 // Wrapper functions the wrapped InkDropedAnimation: |
| 41 float GetCurrentOpacity() const; |
26 void CalculateCircleTransforms(const gfx::Size& size, | 42 void CalculateCircleTransforms(const gfx::Size& size, |
27 InkDropTransforms* transforms_out) const; | 43 InkDropTransforms* transforms_out) const; |
28 void CalculateRectTransforms(const gfx::Size& size, | 44 void CalculateRectTransforms(const gfx::Size& size, |
29 float corner_radius, | 45 float corner_radius, |
30 InkDropTransforms* transforms_out) const; | 46 InkDropTransforms* transforms_out) const; |
31 | 47 |
32 private: | 48 private: |
| 49 // Progresses all running LayerAnimationSequences by the given |duration|. |
| 50 // NOTE: This function will NOT progress LayerAnimationSequences that are |
| 51 // queued, only the running ones will be progressed. |
| 52 void StepAnimations(const base::TimeDelta& duration); |
| 53 |
| 54 // Get a list of all the LayerAnimator's used internally by the |
| 55 // InkDropAnimation. |
| 56 std::vector<ui::LayerAnimator*> GetLayerAnimators(); |
| 57 std::vector<ui::LayerAnimator*> GetLayerAnimators() const; |
| 58 |
33 // The InkDropAnimation to provide internal access to. | 59 // The InkDropAnimation to provide internal access to. |
34 InkDropAnimation* ink_drop_animation_; | 60 InkDropAnimation* ink_drop_animation_; |
35 | 61 |
36 DISALLOW_COPY_AND_ASSIGN(InkDropAnimationTestApi); | 62 DISALLOW_COPY_AND_ASSIGN(InkDropAnimationTestApi); |
37 }; | 63 }; |
38 | 64 |
39 } // namespace test | 65 } // namespace test |
40 } // namespace views | 66 } // namespace views |
41 | 67 |
42 #endif // UI_VIEWS_ANIMATION_TEST_INK_DROP_ANIMATION_TEST_API_H_ | 68 #endif // UI_VIEWS_ANIMATION_TEST_INK_DROP_ANIMATION_TEST_API_H_ |
OLD | NEW |