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/ash_switches.h" | 10 #include "ash/ash_switches.h" |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
243 auth_status_consumer_->OnAuthSuccess(authentication_capture_->user_context); | 243 auth_status_consumer_->OnAuthSuccess(authentication_capture_->user_context); |
244 } | 244 } |
245 authentication_capture_.reset(); | 245 authentication_capture_.reset(); |
246 weak_factory_.InvalidateWeakPtrs(); | 246 weak_factory_.InvalidateWeakPtrs(); |
247 | 247 |
248 VLOG(1) << "Hiding the lock screen."; | 248 VLOG(1) << "Hiding the lock screen."; |
249 chromeos::ScreenLocker::Hide(); | 249 chromeos::ScreenLocker::Hide(); |
250 } | 250 } |
251 | 251 |
252 void ScreenLocker::Authenticate(const UserContext& user_context) { | 252 void ScreenLocker::Authenticate(const UserContext& user_context) { |
253 LOG_ASSERT(IsUserLoggedIn(user_context.GetUserID())) | 253 LOG_ASSERT(IsUserLoggedIn(user_context.GetUserID().GetUserEmail())) |
254 << "Invalid user trying to unlock."; | 254 << "Invalid user trying to unlock."; |
255 | 255 |
256 authentication_start_time_ = base::Time::Now(); | 256 authentication_start_time_ = base::Time::Now(); |
257 delegate_->SetInputEnabled(false); | 257 delegate_->SetInputEnabled(false); |
258 delegate_->OnAuthenticate(); | 258 delegate_->OnAuthenticate(); |
259 | 259 |
260 // Special case: supervised users. Use special authenticator. | 260 // Special case: supervised users. Use special authenticator. |
261 if (const user_manager::User* user = | 261 if (const user_manager::User* user = |
262 FindUnlockUser(user_context.GetUserID())) { | 262 FindUnlockUser(user_context.GetUserID().GetUserEmail())) { |
263 if (user->GetType() == user_manager::USER_TYPE_SUPERVISED) { | 263 if (user->GetType() == user_manager::USER_TYPE_SUPERVISED) { |
264 UserContext updated_context = ChromeUserManager::Get() | 264 UserContext updated_context = ChromeUserManager::Get() |
265 ->GetSupervisedUserManager() | 265 ->GetSupervisedUserManager() |
266 ->GetAuthentication() | 266 ->GetAuthentication() |
267 ->TransformKey(user_context); | 267 ->TransformKey(user_context); |
268 // TODO(antrim) : replace empty closure with explicit method. | 268 // TODO(antrim) : replace empty closure with explicit method. |
269 // http://crbug.com/351268 | 269 // http://crbug.com/351268 |
270 BrowserThread::PostTask( | 270 BrowserThread::PostTask( |
271 BrowserThread::UI, | 271 BrowserThread::UI, |
272 FROM_HERE, | 272 FROM_HERE, |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
505 for (user_manager::UserList::const_iterator it = users_.begin(); | 505 for (user_manager::UserList::const_iterator it = users_.begin(); |
506 it != users_.end(); | 506 it != users_.end(); |
507 ++it) { | 507 ++it) { |
508 if ((*it)->email() == username) | 508 if ((*it)->email() == username) |
509 return true; | 509 return true; |
510 } | 510 } |
511 return false; | 511 return false; |
512 } | 512 } |
513 | 513 |
514 } // namespace chromeos | 514 } // namespace chromeos |
OLD | NEW |