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

Side by Side Diff: ash/wm/lock_state_controller.cc

Issue 2830933002: cros: Use SessionController for lock starting code (Closed)
Patch Set: fix nit Created 3 years, 8 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/wm/lock_state_controller.h ('k') | chrome/browser/chromeos/login/lock/screen_locker.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ash/wm/lock_state_controller.h" 5 #include "ash/wm/lock_state_controller.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 SessionStateAnimator::ANIMATION_GRAYSCALE_BRIGHTNESS, 174 SessionStateAnimator::ANIMATION_GRAYSCALE_BRIGHTNESS,
175 SessionStateAnimator::ANIMATION_SPEED_SHUTDOWN); 175 SessionStateAnimator::ANIMATION_SPEED_SHUTDOWN);
176 StartRealShutdownTimer(true); 176 StartRealShutdownTimer(true);
177 } 177 }
178 178
179 void LockStateController::OnLockScreenHide(base::Closure callback) { 179 void LockStateController::OnLockScreenHide(base::Closure callback) {
180 StartUnlockAnimationBeforeUIDestroyed(callback); 180 StartUnlockAnimationBeforeUIDestroyed(callback);
181 } 181 }
182 182
183 void LockStateController::SetLockScreenDisplayedCallback( 183 void LockStateController::SetLockScreenDisplayedCallback(
184 const base::Closure& callback) { 184 base::OnceClosure callback) {
185 lock_screen_displayed_callback_ = callback; 185 DCHECK(lock_screen_displayed_callback_.is_null());
186 lock_screen_displayed_callback_ = std::move(callback);
186 } 187 }
187 188
188 void LockStateController::OnHostCloseRequested( 189 void LockStateController::OnHostCloseRequested(
189 const aura::WindowTreeHost* host) { 190 const aura::WindowTreeHost* host) {
190 Shell::Get()->shell_delegate()->Exit(); 191 Shell::Get()->shell_delegate()->Exit();
191 } 192 }
192 193
193 void LockStateController::OnChromeTerminating() { 194 void LockStateController::OnChromeTerminating() {
194 // If we hear that Chrome is exiting but didn't request it ourselves, all we 195 // If we hear that Chrome is exiting but didn't request it ourselves, all we
195 // can really hope for is that we'll have time to clear the screen. 196 // can really hope for is that we'll have time to clear the screen.
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after
489 &LockStateController::OnLockFailTimeout); 490 &LockStateController::OnLockFailTimeout);
490 491
491 lock_duration_timer_.reset(new base::ElapsedTimer()); 492 lock_duration_timer_.reset(new base::ElapsedTimer());
492 } 493 }
493 494
494 void LockStateController::PostLockAnimationFinished() { 495 void LockStateController::PostLockAnimationFinished() {
495 animating_lock_ = false; 496 animating_lock_ = false;
496 VLOG(1) << "PostLockAnimationFinished"; 497 VLOG(1) << "PostLockAnimationFinished";
497 ShellPort::Get()->OnLockStateEvent( 498 ShellPort::Get()->OnLockStateEvent(
498 LockStateObserver::EVENT_LOCK_ANIMATION_FINISHED); 499 LockStateObserver::EVENT_LOCK_ANIMATION_FINISHED);
499 if (!lock_screen_displayed_callback_.is_null()) { 500 if (!lock_screen_displayed_callback_.is_null())
500 lock_screen_displayed_callback_.Run(); 501 std::move(lock_screen_displayed_callback_).Run();
501 lock_screen_displayed_callback_.Reset(); 502
502 }
503 CHECK(!views::MenuController::GetActiveInstance()); 503 CHECK(!views::MenuController::GetActiveInstance());
504 if (shutdown_after_lock_) { 504 if (shutdown_after_lock_) {
505 shutdown_after_lock_ = false; 505 shutdown_after_lock_ = false;
506 StartLockToShutdownTimer(); 506 StartLockToShutdownTimer();
507 } 507 }
508 } 508 }
509 509
510 void LockStateController::UnlockAnimationAfterUIDestroyedFinished() { 510 void LockStateController::UnlockAnimationAfterUIDestroyedFinished() {
511 RestoreUnlockedProperties(); 511 RestoreUnlockedProperties();
512 } 512 }
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
552 SessionStateAnimator::AnimationSpeed speed, 552 SessionStateAnimator::AnimationSpeed speed,
553 SessionStateAnimator::AnimationSequence* animation_sequence) { 553 SessionStateAnimator::AnimationSequence* animation_sequence) {
554 if (unlocked_properties_.get() && unlocked_properties_->wallpaper_is_hidden) { 554 if (unlocked_properties_.get() && unlocked_properties_->wallpaper_is_hidden) {
555 animation_sequence->StartAnimation(SessionStateAnimator::WALLPAPER, 555 animation_sequence->StartAnimation(SessionStateAnimator::WALLPAPER,
556 SessionStateAnimator::ANIMATION_FADE_OUT, 556 SessionStateAnimator::ANIMATION_FADE_OUT,
557 speed); 557 speed);
558 } 558 }
559 } 559 }
560 560
561 } // namespace ash 561 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/lock_state_controller.h ('k') | chrome/browser/chromeos/login/lock/screen_locker.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698