| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_HOVER_TEST_API_H_ | 5 #ifndef UI_VIEWS_ANIMATION_TEST_INK_DROP_IMPL_TEST_API_H_ |
| 6 #define UI_VIEWS_ANIMATION_TEST_INK_DROP_HOVER_TEST_API_H_ | 6 #define UI_VIEWS_ANIMATION_TEST_INK_DROP_IMPL_TEST_API_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "ui/compositor/test/multi_layer_animator_test_controller.h" | 11 #include "ui/compositor/test/multi_layer_animator_test_controller.h" |
| 12 #include "ui/compositor/test/multi_layer_animator_test_controller_delegate.h" | 12 #include "ui/compositor/test/multi_layer_animator_test_controller_delegate.h" |
| 13 | 13 |
| 14 namespace ui { | 14 namespace ui { |
| 15 class LayerAnimator; | 15 class LayerAnimator; |
| 16 } // namespace ui | 16 } // namespace ui |
| 17 | 17 |
| 18 namespace views { | 18 namespace views { |
| 19 class InkDropImpl; |
| 19 class InkDropHover; | 20 class InkDropHover; |
| 20 | 21 |
| 21 namespace test { | 22 namespace test { |
| 22 | 23 |
| 23 // Test API to provide internal access to an InkDropHover instance. This can | 24 // Test API to provide internal access to an InkDropImpl instance. This can also |
| 24 // also be used to control the animations via the | 25 // be used to control the InkDropRipple and InkDropHover animations via the |
| 25 // ui::test::MultiLayerAnimatorTestController API. | 26 // ui::test::MultiLayerAnimatorTestController API. |
| 26 class InkDropHoverTestApi | 27 class InkDropImplTestApi |
| 27 : public ui::test::MultiLayerAnimatorTestController, | 28 : public ui::test::MultiLayerAnimatorTestController, |
| 28 public ui::test::MultiLayerAnimatorTestControllerDelegate { | 29 public ui::test::MultiLayerAnimatorTestControllerDelegate { |
| 29 public: | 30 public: |
| 30 explicit InkDropHoverTestApi(InkDropHover* ink_drop_hover); | 31 explicit InkDropImplTestApi(InkDropImpl* ink_drop_controller_); |
| 31 ~InkDropHoverTestApi() override; | 32 ~InkDropImplTestApi() override; |
| 32 | 33 |
| 34 // Wrappers to InkDropImpl internals: |
| 35 const InkDropHover* hover() const; |
| 36 bool IsHoverFadingInOrVisible() const; |
| 37 |
| 38 protected: |
| 33 // MultiLayerAnimatorTestControllerDelegate: | 39 // MultiLayerAnimatorTestControllerDelegate: |
| 34 std::vector<ui::LayerAnimator*> GetLayerAnimators() override; | 40 std::vector<ui::LayerAnimator*> GetLayerAnimators() override; |
| 35 | 41 |
| 36 protected: | 42 private: |
| 37 InkDropHover* ink_drop_hover() { | 43 // The InkDrop to provide internal access to. |
| 38 return static_cast<const InkDropHoverTestApi*>(this)->ink_drop_hover(); | 44 InkDropImpl* ink_drop_; |
| 39 } | |
| 40 | 45 |
| 41 InkDropHover* ink_drop_hover() const { return ink_drop_hover_; } | 46 DISALLOW_COPY_AND_ASSIGN(InkDropImplTestApi); |
| 42 | |
| 43 private: | |
| 44 // The InkDropedAnimation to provide internal access to. | |
| 45 InkDropHover* ink_drop_hover_; | |
| 46 | |
| 47 DISALLOW_COPY_AND_ASSIGN(InkDropHoverTestApi); | |
| 48 }; | 47 }; |
| 49 | 48 |
| 50 } // namespace test | 49 } // namespace test |
| 51 } // namespace views | 50 } // namespace views |
| 52 | 51 |
| 53 #endif // UI_VIEWS_ANIMATION_TEST_INK_DROP_HOVER_TEST_API_H_ | 52 #endif // UI_VIEWS_ANIMATION_TEST_INK_DROP_IMPL_TEST_API_H_ |
| OLD | NEW |