| OLD | NEW |
| 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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 | 76 |
| 77 LockStateController::TestApi::TestApi(LockStateController* controller) | 77 LockStateController::TestApi::TestApi(LockStateController* controller) |
| 78 : controller_(controller) { | 78 : controller_(controller) { |
| 79 } | 79 } |
| 80 | 80 |
| 81 LockStateController::TestApi::~TestApi() { | 81 LockStateController::TestApi::~TestApi() { |
| 82 } | 82 } |
| 83 | 83 |
| 84 LockStateController::LockStateController() | 84 LockStateController::LockStateController() |
| 85 : animator_(new SessionStateAnimatorImpl()), | 85 : animator_(new SessionStateAnimatorImpl()), |
| 86 login_status_(user::LOGGED_IN_NONE), | 86 login_status_(LoginStatus::NOT_LOGGED_IN), |
| 87 system_is_locked_(false), | 87 system_is_locked_(false), |
| 88 shutting_down_(false), | 88 shutting_down_(false), |
| 89 shutdown_after_lock_(false), | 89 shutdown_after_lock_(false), |
| 90 animating_lock_(false), | 90 animating_lock_(false), |
| 91 can_cancel_lock_animation_(false), | 91 can_cancel_lock_animation_(false), |
| 92 lock_fail_timer_is_stopped_(true), | 92 lock_fail_timer_is_stopped_(true), |
| 93 weak_ptr_factory_(this) { | 93 weak_ptr_factory_(this) { |
| 94 Shell::GetPrimaryRootWindow()->GetHost()->AddObserver(this); | 94 Shell::GetPrimaryRootWindow()->GetHost()->AddObserver(this); |
| 95 } | 95 } |
| 96 | 96 |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 218 void LockStateController::SetLockScreenDisplayedCallback( | 218 void LockStateController::SetLockScreenDisplayedCallback( |
| 219 const base::Closure& callback) { | 219 const base::Closure& callback) { |
| 220 lock_screen_displayed_callback_ = callback; | 220 lock_screen_displayed_callback_ = callback; |
| 221 } | 221 } |
| 222 | 222 |
| 223 void LockStateController::OnHostCloseRequested( | 223 void LockStateController::OnHostCloseRequested( |
| 224 const aura::WindowTreeHost* host) { | 224 const aura::WindowTreeHost* host) { |
| 225 Shell::GetInstance()->delegate()->Exit(); | 225 Shell::GetInstance()->delegate()->Exit(); |
| 226 } | 226 } |
| 227 | 227 |
| 228 void LockStateController::OnLoginStateChanged( | 228 void LockStateController::OnLoginStateChanged(LoginStatus status) { |
| 229 user::LoginStatus status) { | |
| 230 // TODO(jdufault): Remove after resolving crbug.com/452599. | 229 // TODO(jdufault): Remove after resolving crbug.com/452599. |
| 231 VLOG(0) << "LockStateController::OnLoginStateChanged login_status_: " | 230 VLOG(0) << "LockStateController::OnLoginStateChanged login_status_: " |
| 232 << login_status_ << ", status: " << status; | 231 << static_cast<int>(login_status_) |
| 233 if (status != user::LOGGED_IN_LOCKED) | 232 << ", status: " << static_cast<int>(status); |
| 233 if (status != LoginStatus::LOCKED) |
| 234 login_status_ = status; | 234 login_status_ = status; |
| 235 system_is_locked_ = (status == user::LOGGED_IN_LOCKED); | 235 system_is_locked_ = (status == LoginStatus::LOCKED); |
| 236 } | 236 } |
| 237 | 237 |
| 238 void LockStateController::OnAppTerminating() { | 238 void LockStateController::OnAppTerminating() { |
| 239 // If we hear that Chrome is exiting but didn't request it ourselves, all we | 239 // If we hear that Chrome is exiting but didn't request it ourselves, all we |
| 240 // can really hope for is that we'll have time to clear the screen. | 240 // can really hope for is that we'll have time to clear the screen. |
| 241 // This is also the case when the user signs off. | 241 // This is also the case when the user signs off. |
| 242 if (!shutting_down_) { | 242 if (!shutting_down_) { |
| 243 shutting_down_ = true; | 243 shutting_down_ = true; |
| 244 Shell* shell = ash::Shell::GetInstance(); | 244 Shell* shell = ash::Shell::GetInstance(); |
| 245 shell->cursor_manager()->HideCursor(); | 245 shell->cursor_manager()->HideCursor(); |
| (...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 632 if (unlocked_properties_.get() && | 632 if (unlocked_properties_.get() && |
| 633 unlocked_properties_->background_is_hidden) { | 633 unlocked_properties_->background_is_hidden) { |
| 634 animation_sequence->StartAnimation( | 634 animation_sequence->StartAnimation( |
| 635 SessionStateAnimator::DESKTOP_BACKGROUND, | 635 SessionStateAnimator::DESKTOP_BACKGROUND, |
| 636 SessionStateAnimator::ANIMATION_FADE_OUT, | 636 SessionStateAnimator::ANIMATION_FADE_OUT, |
| 637 speed); | 637 speed); |
| 638 } | 638 } |
| 639 } | 639 } |
| 640 | 640 |
| 641 } // namespace ash | 641 } // namespace ash |
| OLD | NEW |