| OLD | NEW |
| (Empty) | |
| 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 |
| 5 #include "ash/rotator/screen_rotation_animator_lock.h" |
| 6 |
| 7 #include "ash/rotator/screen_rotation_animator.h" |
| 8 |
| 9 namespace ash { |
| 10 |
| 11 ScreenRotationAnimatorLock::ScreenRotationAnimatorLock( |
| 12 base::WeakPtr<ScreenRotationAnimator> animator) |
| 13 : animator_(animator) {} |
| 14 |
| 15 ScreenRotationAnimatorLock::~ScreenRotationAnimatorLock() { |
| 16 unlock(); |
| 17 } |
| 18 |
| 19 void ScreenRotationAnimatorLock::lock() { |
| 20 if (animator_) |
| 21 animator_->AddAnimatorLock(this); |
| 22 } |
| 23 |
| 24 void ScreenRotationAnimatorLock::unlock() { |
| 25 if (animator_) |
| 26 animator_->RemoveAnimatorLock(this); |
| 27 } |
| 28 |
| 29 void ScreenRotationAnimatorLock::TimeoutLock() { |
| 30 unlock(); |
| 31 animator_ = nullptr; |
| 32 } |
| 33 |
| 34 } // namespace ash |
| OLD | NEW |