| 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 #include "ui/views/animation/test/ink_drop_impl_test_api.h" | 5 #include "ui/views/animation/test/ink_drop_impl_test_api.h" |
| 6 | 6 |
| 7 #include "ui/views/animation/ink_drop_hover.h" | 7 #include "ui/views/animation/ink_drop_highlight.h" |
| 8 #include "ui/views/animation/ink_drop_impl.h" | 8 #include "ui/views/animation/ink_drop_impl.h" |
| 9 #include "ui/views/animation/ink_drop_ripple.h" | 9 #include "ui/views/animation/ink_drop_ripple.h" |
| 10 #include "ui/views/animation/test/ink_drop_hover_test_api.h" | 10 #include "ui/views/animation/test/ink_drop_highlight_test_api.h" |
| 11 #include "ui/views/animation/test/ink_drop_ripple_test_api.h" | 11 #include "ui/views/animation/test/ink_drop_ripple_test_api.h" |
| 12 | 12 |
| 13 namespace views { | 13 namespace views { |
| 14 namespace test { | 14 namespace test { |
| 15 | 15 |
| 16 InkDropImplTestApi::InkDropImplTestApi(InkDropImpl* ink_drop) | 16 InkDropImplTestApi::InkDropImplTestApi(InkDropImpl* ink_drop) |
| 17 : ui::test::MultiLayerAnimatorTestController(this), ink_drop_(ink_drop) {} | 17 : ui::test::MultiLayerAnimatorTestController(this), ink_drop_(ink_drop) {} |
| 18 | 18 |
| 19 InkDropImplTestApi::~InkDropImplTestApi() {} | 19 InkDropImplTestApi::~InkDropImplTestApi() {} |
| 20 | 20 |
| 21 const InkDropHover* InkDropImplTestApi::hover() const { | 21 const InkDropHighlight* InkDropImplTestApi::highlight() const { |
| 22 return ink_drop_->hover_.get(); | 22 return ink_drop_->highlight_.get(); |
| 23 } | 23 } |
| 24 | 24 |
| 25 bool InkDropImplTestApi::IsHoverFadingInOrVisible() const { | 25 bool InkDropImplTestApi::IsHighlightFadingInOrVisible() const { |
| 26 return ink_drop_->IsHoverFadingInOrVisible(); | 26 return ink_drop_->IsHighlightFadingInOrVisible(); |
| 27 } | 27 } |
| 28 | 28 |
| 29 std::vector<ui::LayerAnimator*> InkDropImplTestApi::GetLayerAnimators() { | 29 std::vector<ui::LayerAnimator*> InkDropImplTestApi::GetLayerAnimators() { |
| 30 std::vector<ui::LayerAnimator*> animators; | 30 std::vector<ui::LayerAnimator*> animators; |
| 31 | 31 |
| 32 if (ink_drop_->hover_) { | 32 if (ink_drop_->highlight_) { |
| 33 InkDropHoverTestApi* ink_drop_hover_test_api = | 33 InkDropHighlightTestApi* ink_drop_highlight_test_api = |
| 34 ink_drop_->hover_->GetTestApi(); | 34 ink_drop_->highlight_->GetTestApi(); |
| 35 std::vector<ui::LayerAnimator*> ink_drop_hover_animators = | 35 std::vector<ui::LayerAnimator*> ink_drop_highlight_animators = |
| 36 ink_drop_hover_test_api->GetLayerAnimators(); | 36 ink_drop_highlight_test_api->GetLayerAnimators(); |
| 37 animators.insert(animators.end(), ink_drop_hover_animators.begin(), | 37 animators.insert(animators.end(), ink_drop_highlight_animators.begin(), |
| 38 ink_drop_hover_animators.end()); | 38 ink_drop_highlight_animators.end()); |
| 39 } | 39 } |
| 40 | 40 |
| 41 if (ink_drop_->ink_drop_ripple_) { | 41 if (ink_drop_->ink_drop_ripple_) { |
| 42 InkDropRippleTestApi* ink_drop_ripple_test_api = | 42 InkDropRippleTestApi* ink_drop_ripple_test_api = |
| 43 ink_drop_->ink_drop_ripple_->GetTestApi(); | 43 ink_drop_->ink_drop_ripple_->GetTestApi(); |
| 44 std::vector<ui::LayerAnimator*> ink_drop_ripple_animators = | 44 std::vector<ui::LayerAnimator*> ink_drop_ripple_animators = |
| 45 ink_drop_ripple_test_api->GetLayerAnimators(); | 45 ink_drop_ripple_test_api->GetLayerAnimators(); |
| 46 animators.insert(animators.end(), ink_drop_ripple_animators.begin(), | 46 animators.insert(animators.end(), ink_drop_ripple_animators.begin(), |
| 47 ink_drop_ripple_animators.end()); | 47 ink_drop_ripple_animators.end()); |
| 48 } | 48 } |
| 49 | 49 |
| 50 return animators; | 50 return animators; |
| 51 } | 51 } |
| 52 | 52 |
| 53 } // namespace test | 53 } // namespace test |
| 54 } // namespace views | 54 } // namespace views |
| OLD | NEW |