| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef UI_VIEWS_ANIMATION_TEST_SQUARE_INK_DROP_ANIMATION_TEST_API_H_ | |
| 6 #define UI_VIEWS_ANIMATION_TEST_SQUARE_INK_DROP_ANIMATION_TEST_API_H_ | |
| 7 | |
| 8 #include <vector> | |
| 9 | |
| 10 #include "base/macros.h" | |
| 11 #include "ui/gfx/geometry/size.h" | |
| 12 #include "ui/views/animation/square_ink_drop_animation.h" | |
| 13 #include "ui/views/animation/test/ink_drop_animation_test_api.h" | |
| 14 | |
| 15 namespace ui { | |
| 16 class LayerAnimator; | |
| 17 } // namespace ui | |
| 18 | |
| 19 namespace views { | |
| 20 namespace test { | |
| 21 | |
| 22 // Test API to provide internal access to a SquareInkDropAnimation. | |
| 23 class SquareInkDropAnimationTestApi : public InkDropAnimationTestApi { | |
| 24 public: | |
| 25 // Make the private typedefs accessible. | |
| 26 using InkDropTransforms = SquareInkDropAnimation::InkDropTransforms; | |
| 27 using PaintedShape = SquareInkDropAnimation::PaintedShape; | |
| 28 | |
| 29 explicit SquareInkDropAnimationTestApi( | |
| 30 SquareInkDropAnimation* ink_drop_animation); | |
| 31 ~SquareInkDropAnimationTestApi() override; | |
| 32 | |
| 33 // Wrapper functions to the wrapped InkDropAnimation: | |
| 34 void CalculateCircleTransforms(const gfx::Size& size, | |
| 35 InkDropTransforms* transforms_out) const; | |
| 36 void CalculateRectTransforms(const gfx::Size& size, | |
| 37 float corner_radius, | |
| 38 InkDropTransforms* transforms_out) const; | |
| 39 | |
| 40 // InkDropAnimationTestApi: | |
| 41 float GetCurrentOpacity() const override; | |
| 42 | |
| 43 protected: | |
| 44 // InkDropAnimationTestApi: | |
| 45 std::vector<ui::LayerAnimator*> GetLayerAnimators() override; | |
| 46 | |
| 47 private: | |
| 48 SquareInkDropAnimation* ink_drop_animation() { | |
| 49 return static_cast<const SquareInkDropAnimationTestApi*>(this) | |
| 50 ->ink_drop_animation(); | |
| 51 } | |
| 52 | |
| 53 SquareInkDropAnimation* ink_drop_animation() const { | |
| 54 return static_cast<SquareInkDropAnimation*>( | |
| 55 InkDropAnimationTestApi::ink_drop_animation()); | |
| 56 } | |
| 57 | |
| 58 DISALLOW_COPY_AND_ASSIGN(SquareInkDropAnimationTestApi); | |
| 59 }; | |
| 60 | |
| 61 } // namespace test | |
| 62 } // namespace views | |
| 63 | |
| 64 #endif // UI_VIEWS_ANIMATION_TEST_SQUARE_INK_DROP_ANIMATION_TEST_API_H_ | |
| OLD | NEW |