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

Side by Side Diff: ash/session/session_controller.cc

Issue 2836163002: mash: Shell ref clean up for screen lock (Closed)
Patch Set: rebase, fix compile 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/session/session_controller.h ('k') | chrome/browser/chromeos/login/lock/screen_locker.cc » ('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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/session/session_controller.h" 5 #include "ash/session/session_controller.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "ash/session/session_observer.h" 9 #include "ash/session/session_observer.h"
10 #include "ash/shell.h" 10 #include "ash/shell.h"
11 #include "ash/system/power/power_event_observer.h"
11 #include "ash/wm/lock_state_controller.h" 12 #include "ash/wm/lock_state_controller.h"
12 #include "base/bind.h" 13 #include "base/bind.h"
13 #include "base/bind_helpers.h" 14 #include "base/bind_helpers.h"
14 #include "base/command_line.h" 15 #include "base/command_line.h"
15 #include "chromeos/chromeos_switches.h" 16 #include "chromeos/chromeos_switches.h"
16 #include "components/signin/core/account_id/account_id.h" 17 #include "components/signin/core/account_id/account_id.h"
17 #include "components/user_manager/user_type.h" 18 #include "components/user_manager/user_type.h"
18 #include "services/service_manager/public/cpp/connector.h" 19 #include "services/service_manager/public/cpp/connector.h"
19 20
20 using session_manager::SessionState; 21 using session_manager::SessionState;
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 236
236 LockStateController* const lock_state_controller = 237 LockStateController* const lock_state_controller =
237 Shell::Get()->lock_state_controller(); 238 Shell::Get()->lock_state_controller();
238 239
239 lock_state_controller->SetLockScreenDisplayedCallback( 240 lock_state_controller->SetLockScreenDisplayedCallback(
240 base::Bind(&SessionController::OnLockAnimationFinished, 241 base::Bind(&SessionController::OnLockAnimationFinished,
241 weak_ptr_factory_.GetWeakPtr())); 242 weak_ptr_factory_.GetWeakPtr()));
242 lock_state_controller->OnStartingLock(); 243 lock_state_controller->OnStartingLock();
243 } 244 }
244 245
246 void SessionController::NotifyChromeLockAnimationsComplete() {
247 Shell::Get()->power_event_observer()->OnLockAnimationsComplete();
248 }
249
245 void SessionController::RunUnlockAnimation( 250 void SessionController::RunUnlockAnimation(
246 const RunUnlockAnimationCallback& callback) { 251 const RunUnlockAnimationCallback& callback) {
247 is_unlocking_ = true; 252 is_unlocking_ = true;
248 253
249 // Shell could have no instance in tests. 254 // Shell could have no instance in tests.
250 if (Shell::HasInstance()) 255 if (Shell::HasInstance())
251 Shell::Get()->lock_state_controller()->OnLockScreenHide(callback); 256 Shell::Get()->lock_state_controller()->OnLockScreenHide(callback);
252 } 257 }
253 258
254 void SessionController::NotifyChromeTerminating() { 259 void SessionController::NotifyChromeTerminating() {
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
366 for (auto& observer : observers_) 371 for (auto& observer : observers_)
367 observer.OnLoginStatusChanged(login_status_); 372 observer.OnLoginStatusChanged(login_status_);
368 } 373 }
369 374
370 void SessionController::OnLockAnimationFinished() { 375 void SessionController::OnLockAnimationFinished() {
371 if (!start_lock_callback_.is_null()) 376 if (!start_lock_callback_.is_null())
372 std::move(start_lock_callback_).Run(true /* locked */); 377 std::move(start_lock_callback_).Run(true /* locked */);
373 } 378 }
374 379
375 } // namespace ash 380 } // namespace ash
OLDNEW
« no previous file with comments | « ash/session/session_controller.h ('k') | chrome/browser/chromeos/login/lock/screen_locker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698