| Index: ash/rotator/screen_rotation_animator_lock.cc
|
| diff --git a/ash/rotator/screen_rotation_animator_lock.cc b/ash/rotator/screen_rotation_animator_lock.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..c4239eef773bb1250c39922eae60ad2a0aa21b1f
|
| --- /dev/null
|
| +++ b/ash/rotator/screen_rotation_animator_lock.cc
|
| @@ -0,0 +1,34 @@
|
| +// 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_lock.h"
|
| +
|
| +#include "ash/rotator/screen_rotation_animator.h"
|
| +
|
| +namespace ash {
|
| +
|
| +ScreenRotationAnimatorLock::ScreenRotationAnimatorLock(
|
| + base::WeakPtr<ScreenRotationAnimator> animator)
|
| + : animator_(animator) {}
|
| +
|
| +ScreenRotationAnimatorLock::~ScreenRotationAnimatorLock() {
|
| + unlock();
|
| +}
|
| +
|
| +void ScreenRotationAnimatorLock::lock() {
|
| + if (animator_)
|
| + animator_->AddAnimatorLock(this);
|
| +}
|
| +
|
| +void ScreenRotationAnimatorLock::unlock() {
|
| + if (animator_)
|
| + animator_->RemoveAnimatorLock(this);
|
| +}
|
| +
|
| +void ScreenRotationAnimatorLock::TimeoutLock() {
|
| + unlock();
|
| + animator_ = nullptr;
|
| +}
|
| +
|
| +} // namespace ash
|
|
|