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

Unified 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/lock_state_controller.cc
diff --git a/ash/wm/lock_state_controller.cc b/ash/wm/lock_state_controller.cc
index 2370054f4070e8aeb71e7d594b773ad5ce7e44f6..0b996a177087aef5e2083fbdbf073ca0e4beb8a2 100644
--- a/ash/wm/lock_state_controller.cc
+++ b/ash/wm/lock_state_controller.cc
@@ -181,8 +181,9 @@ void LockStateController::OnLockScreenHide(base::Closure callback) {
}
void LockStateController::SetLockScreenDisplayedCallback(
- const base::Closure& callback) {
- lock_screen_displayed_callback_ = callback;
+ base::OnceClosure callback) {
+ DCHECK(lock_screen_displayed_callback_.is_null());
+ lock_screen_displayed_callback_ = std::move(callback);
}
void LockStateController::OnHostCloseRequested(
@@ -496,10 +497,9 @@ void LockStateController::PostLockAnimationFinished() {
VLOG(1) << "PostLockAnimationFinished";
ShellPort::Get()->OnLockStateEvent(
LockStateObserver::EVENT_LOCK_ANIMATION_FINISHED);
- if (!lock_screen_displayed_callback_.is_null()) {
- lock_screen_displayed_callback_.Run();
- lock_screen_displayed_callback_.Reset();
- }
+ if (!lock_screen_displayed_callback_.is_null())
+ std::move(lock_screen_displayed_callback_).Run();
+
CHECK(!views::MenuController::GetActiveInstance());
if (shutdown_after_lock_) {
shutdown_after_lock_ = false;
« 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