| OLD | NEW |
| 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 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 | 240 |
| 240 LockStateController* const lock_state_controller = | 241 LockStateController* const lock_state_controller = |
| 241 Shell::Get()->lock_state_controller(); | 242 Shell::Get()->lock_state_controller(); |
| 242 | 243 |
| 243 lock_state_controller->SetLockScreenDisplayedCallback( | 244 lock_state_controller->SetLockScreenDisplayedCallback( |
| 244 base::Bind(&SessionController::OnLockAnimationFinished, | 245 base::Bind(&SessionController::OnLockAnimationFinished, |
| 245 weak_ptr_factory_.GetWeakPtr())); | 246 weak_ptr_factory_.GetWeakPtr())); |
| 246 lock_state_controller->OnStartingLock(); | 247 lock_state_controller->OnStartingLock(); |
| 247 } | 248 } |
| 248 | 249 |
| 250 void SessionController::NotifyChromeLockAnimationsComplete() { |
| 251 Shell::Get()->power_event_observer()->OnLockAnimationsComplete(); |
| 252 } |
| 253 |
| 249 void SessionController::RunUnlockAnimation( | 254 void SessionController::RunUnlockAnimation( |
| 250 const RunUnlockAnimationCallback& callback) { | 255 const RunUnlockAnimationCallback& callback) { |
| 251 is_unlocking_ = true; | 256 is_unlocking_ = true; |
| 252 | 257 |
| 253 // Shell could have no instance in tests. | 258 // Shell could have no instance in tests. |
| 254 if (Shell::HasInstance()) | 259 if (Shell::HasInstance()) |
| 255 Shell::Get()->lock_state_controller()->OnLockScreenHide(callback); | 260 Shell::Get()->lock_state_controller()->OnLockScreenHide(callback); |
| 256 } | 261 } |
| 257 | 262 |
| 258 void SessionController::NotifyChromeTerminating() { | 263 void SessionController::NotifyChromeTerminating() { |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 370 for (auto& observer : observers_) | 375 for (auto& observer : observers_) |
| 371 observer.OnLoginStatusChanged(login_status_); | 376 observer.OnLoginStatusChanged(login_status_); |
| 372 } | 377 } |
| 373 | 378 |
| 374 void SessionController::OnLockAnimationFinished() { | 379 void SessionController::OnLockAnimationFinished() { |
| 375 if (!start_lock_callback_.is_null()) | 380 if (!start_lock_callback_.is_null()) |
| 376 std::move(start_lock_callback_).Run(true /* locked */); | 381 std::move(start_lock_callback_).Run(true /* locked */); |
| 377 } | 382 } |
| 378 | 383 |
| 379 } // namespace ash | 384 } // namespace ash |
| OLD | NEW |