screen_rotation_animator_test_api.cc 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  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
  3. // found in the LICENSE file.
  4. #include "ash/rotator/screen_rotation_animator_test_api.h"
  5. #include "ash/rotator/screen_rotation_animator.h"
  6. #include "ui/compositor/layer.h"
  7. #include "ui/compositor/layer_tree_owner.h"
  8. namespace ash {
  9. ScreenRotationAnimatorTestApi::ScreenRotationAnimatorTestApi(
  10. ScreenRotationAnimator* animator)
  11. : ui::test::MultiLayerAnimatorTestController(this), animator_(animator) {}
  12. ScreenRotationAnimatorTestApi::~ScreenRotationAnimatorTestApi() = default;
  13. void ScreenRotationAnimatorTestApi::DisableAnimationTimers() {
  14. animator_->set_disable_animation_timers_for_test(true);
  15. }
  16. std::vector<ui::LayerAnimator*>
  17. ScreenRotationAnimatorTestApi::GetLayerAnimators() {
  18. std::vector<ui::LayerAnimator*> animators;
  19. if (animator_->old_layer_tree_owner_) {
  20. animators.insert(animators.end(),
  21. animator_->old_layer_tree_owner_->root()->GetAnimator());
  22. }
  23. if (animator_->new_layer_tree_owner_) {
  24. animators.insert(animators.end(),
  25. animator_->new_layer_tree_owner_->root()->GetAnimator());
  26. }
  27. return animators;
  28. }
  29. } // namespace ash