blob: a0ae82c61f826873c85ed92c238006a8093367c3 [file] [log] [blame]
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "ash/rotator/screen_rotation_animator_test_api.h"
#include "ash/rotator/screen_rotation_animator.h"
#include "ui/compositor/layer.h"
#include "ui/compositor/layer_tree_owner.h"
namespace ash {
ScreenRotationAnimatorTestApi::ScreenRotationAnimatorTestApi(
ScreenRotationAnimator* animator)
: ui::test::MultiLayerAnimatorTestController(this), animator_(animator) {}
ScreenRotationAnimatorTestApi::~ScreenRotationAnimatorTestApi() = default;
void ScreenRotationAnimatorTestApi::DisableAnimationTimers() {
animator_->set_disable_animation_timers_for_test(true);
}
std::vector<ui::LayerAnimator*>
ScreenRotationAnimatorTestApi::GetLayerAnimators() {
std::vector<ui::LayerAnimator*> animators;
if (animator_->old_layer_tree_owner_) {
animators.insert(animators.end(),
animator_->old_layer_tree_owner_->root()->GetAnimator());
}
if (animator_->new_layer_tree_owner_) {
animators.insert(animators.end(),
animator_->new_layer_tree_owner_->root()->GetAnimator());
}
return animators;
}
} // namespace ash