Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(15)

Side by Side Diff: ash/rotator/screen_rotation_animator_lock.cc

Issue 2848883004: Add screen rotation animator lock. (Closed)
Patch Set: Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ash/rotator/screen_rotation_animator_lock.h ('k') | ash/wallpaper/wallpaper_controller.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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
OLDNEW
« no previous file with comments | « ash/rotator/screen_rotation_animator_lock.h ('k') | ash/wallpaper/wallpaper_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698