| 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_INK_DROP_ANIMATION_TEST_API_H_ | |
| 6 #define UI_VIEWS_ANIMATION_TEST_INK_DROP_ANIMATION_TEST_API_H_ | |
| 7 | |
| 8 #include <vector> | |
| 9 | |
| 10 #include "base/macros.h" | |
| 11 #include "ui/compositor/test/multi_layer_animator_test_controller.h" | |
| 12 #include "ui/compositor/test/multi_layer_animator_test_controller_delegate.h" | |
| 13 | |
| 14 namespace ui { | |
| 15 class LayerAnimator; | |
| 16 } // namespace ui | |
| 17 | |
| 18 namespace views { | |
| 19 class InkDropAnimation; | |
| 20 | |
| 21 namespace test { | |
| 22 | |
| 23 // Test API to provide internal access to an InkDropAnimation instance. This can | |
| 24 // also be used to control the animations via the | |
| 25 // ui::test::MultiLayerAnimatorTestController API. | |
| 26 class InkDropAnimationTestApi | |
| 27 : public ui::test::MultiLayerAnimatorTestController, | |
| 28 public ui::test::MultiLayerAnimatorTestControllerDelegate { | |
| 29 public: | |
| 30 explicit InkDropAnimationTestApi(InkDropAnimation* ink_drop_animation); | |
| 31 ~InkDropAnimationTestApi() override; | |
| 32 | |
| 33 // Gets the opacity of the ink drop. | |
| 34 virtual float GetCurrentOpacity() const = 0; | |
| 35 | |
| 36 // MultiLayerAnimatorTestControllerDelegate: | |
| 37 std::vector<ui::LayerAnimator*> GetLayerAnimators() override; | |
| 38 | |
| 39 protected: | |
| 40 InkDropAnimation* ink_drop_animation() { | |
| 41 return static_cast<const InkDropAnimationTestApi*>(this) | |
| 42 ->ink_drop_animation(); | |
| 43 } | |
| 44 | |
| 45 InkDropAnimation* ink_drop_animation() const { return ink_drop_animation_; } | |
| 46 | |
| 47 private: | |
| 48 // The InkDropedAnimation to provide internal access to. | |
| 49 InkDropAnimation* ink_drop_animation_; | |
| 50 | |
| 51 DISALLOW_COPY_AND_ASSIGN(InkDropAnimationTestApi); | |
| 52 }; | |
| 53 | |
| 54 } // namespace test | |
| 55 } // namespace views | |
| 56 | |
| 57 #endif // UI_VIEWS_ANIMATION_TEST_INK_DROP_ANIMATION_TEST_API_H_ | |
| OLD | NEW |