| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "chrome/browser/chromeos/login/lock/screen_locker.h" | 5 #include "chrome/browser/chromeos/login/lock/screen_locker.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "ash/login/views/lock_screen.h" | 10 #include "ash/login/views/lock_screen.h" |
| (...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 | 235 |
| 236 authenticator_ = UserSessionManager::GetInstance()->CreateAuthenticator(this); | 236 authenticator_ = UserSessionManager::GetInstance()->CreateAuthenticator(this); |
| 237 extended_authenticator_ = ExtendedAuthenticator::Create(this); | 237 extended_authenticator_ = ExtendedAuthenticator::Create(this); |
| 238 if (IsUsingMdLogin()) { | 238 if (IsUsingMdLogin()) { |
| 239 // Create delegate that will eventually call into the views-based lock | 239 // Create delegate that will eventually call into the views-based lock |
| 240 // screen via mojo. | 240 // screen via mojo. |
| 241 delegate_ = new StubDelegate(); | 241 delegate_ = new StubDelegate(); |
| 242 owns_delegate_ = true; | 242 owns_delegate_ = true; |
| 243 | 243 |
| 244 // Create and display lock screen. | 244 // Create and display lock screen. |
| 245 // TODO(jdufualt): LockWindow should live in ash. | 245 // TODO(jdufault): Calling ash::ShowLockScreen should be a mojo call. We |
| 246 // TODO(jdufault): Calling ash::ShowLockScreenInWidget should be a mojo | 246 // should only set the session state to locked after the mojo call has |
| 247 // call. We should only set the session state to locked after the mojo call | 247 // completed. |
| 248 // has completed. | 248 if (ash::ShowLockScreen()) { |
| 249 LockWindow* lock_window = new LockWindow(); | 249 session_manager::SessionManager::Get()->SetSessionState( |
| 250 lock_window->SetBounds( | 250 session_manager::SessionState::LOCKED); |
| 251 display::Screen::GetScreen()->GetPrimaryDisplay().bounds()); | 251 } |
| 252 ash::ShowLockScreenInWidget(lock_window); | |
| 253 session_manager::SessionManager::Get()->SetSessionState( | |
| 254 session_manager::SessionState::LOCKED); | |
| 255 } else { | 252 } else { |
| 256 web_ui_.reset(new WebUIScreenLocker(this)); | 253 web_ui_.reset(new WebUIScreenLocker(this)); |
| 257 delegate_ = web_ui_.get(); | 254 delegate_ = web_ui_.get(); |
| 258 owns_delegate_ = false; | 255 owns_delegate_ = false; |
| 259 web_ui_->LockScreen(); | 256 web_ui_->LockScreen(); |
| 260 | 257 |
| 261 // Ownership of |icon_image_source| is passed. | 258 // Ownership of |icon_image_source| is passed. |
| 262 screenlock_icon_provider_ = base::MakeUnique<ScreenlockIconProvider>(); | 259 screenlock_icon_provider_ = base::MakeUnique<ScreenlockIconProvider>(); |
| 263 ScreenlockIconSource* screenlock_icon_source = | 260 ScreenlockIconSource* screenlock_icon_source = |
| 264 new ScreenlockIconSource(screenlock_icon_provider_->AsWeakPtr()); | 261 new ScreenlockIconSource(screenlock_icon_provider_->AsWeakPtr()); |
| (...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 719 } | 716 } |
| 720 } | 717 } |
| 721 | 718 |
| 722 if (auth_status_consumer_) { | 719 if (auth_status_consumer_) { |
| 723 AuthFailure failure(AuthFailure::UNLOCK_FAILED); | 720 AuthFailure failure(AuthFailure::UNLOCK_FAILED); |
| 724 auth_status_consumer_->OnAuthFailure(failure); | 721 auth_status_consumer_->OnAuthFailure(failure); |
| 725 } | 722 } |
| 726 } | 723 } |
| 727 | 724 |
| 728 } // namespace chromeos | 725 } // namespace chromeos |
| OLD | NEW |