| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 "ash/rotator/test/screen_rotation_animator_test_api.h" | 5 #include "ash/rotator/test/screen_rotation_animator_test_api.h" |
| 6 | 6 |
| 7 #include "ash/rotator/screen_rotation_animator.h" | 7 #include "ash/rotator/screen_rotation_animator.h" |
| 8 #include "ui/compositor/layer.h" | 8 #include "ui/compositor/layer.h" |
| 9 #include "ui/compositor/layer_tree_owner.h" | 9 #include "ui/compositor/layer_tree_owner.h" |
| 10 | 10 |
| 11 namespace ash { | 11 namespace ash { |
| 12 namespace test { | 12 namespace test { |
| 13 | 13 |
| 14 ScreenRotationAnimatorTestApi::ScreenRotationAnimatorTestApi( | 14 ScreenRotationAnimatorTestApi::ScreenRotationAnimatorTestApi( |
| 15 ScreenRotationAnimator* animator) | 15 ScreenRotationAnimator* animator) |
| 16 : ui::test::MultiLayerAnimatorTestController(this), animator_(animator) {} | 16 : ui::test::MultiLayerAnimatorTestController(this), animator_(animator) {} |
| 17 | 17 |
| 18 ScreenRotationAnimatorTestApi::~ScreenRotationAnimatorTestApi() {} | 18 ScreenRotationAnimatorTestApi::~ScreenRotationAnimatorTestApi() {} |
| 19 | 19 |
| 20 void ScreenRotationAnimatorTestApi::DisableAnimationTimers() { | 20 void ScreenRotationAnimatorTestApi::DisableAnimationTimers() { |
| 21 animator_->set_disable_animation_timers_for_test(true); | 21 animator_->set_disable_animation_timers_for_test(true); |
| 22 } | 22 } |
| 23 | 23 |
| 24 void ScreenRotationAnimatorTestApi::SetEnableAnimation(bool enable) { |
| 25 animator_->set_enable_animation_for_test(enable); |
| 26 } |
| 27 |
| 24 std::vector<ui::LayerAnimator*> | 28 std::vector<ui::LayerAnimator*> |
| 25 ScreenRotationAnimatorTestApi::GetLayerAnimators() { | 29 ScreenRotationAnimatorTestApi::GetLayerAnimators() { |
| 26 std::vector<ui::LayerAnimator*> animators; | 30 std::vector<ui::LayerAnimator*> animators; |
| 27 if (animator_->old_layer_tree_owner_) { | 31 if (animator_->old_layer_tree_owner_) { |
| 28 animators.insert(animators.end(), | 32 animators.insert(animators.end(), |
| 29 animator_->old_layer_tree_owner_->root()->GetAnimator()); | 33 animator_->old_layer_tree_owner_->root()->GetAnimator()); |
| 30 } | 34 } |
| 31 if (animator_->new_layer_tree_owner_) { | 35 if (animator_->new_layer_tree_owner_) { |
| 32 animators.insert(animators.end(), | 36 animators.insert(animators.end(), |
| 33 animator_->new_layer_tree_owner_->root()->GetAnimator()); | 37 animator_->new_layer_tree_owner_->root()->GetAnimator()); |
| 34 } | 38 } |
| 35 return animators; | 39 return animators; |
| 36 } | 40 } |
| 37 | 41 |
| 38 } // namespace test | 42 } // namespace test |
| 39 } // namespace ash | 43 } // namespace ash |
| OLD | NEW |