| 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 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 LOG_ASSERT(IsUserLoggedIn(user_context.GetUserID())) | 245 LOG_ASSERT(IsUserLoggedIn(user_context.GetUserID())) |
| 246 << "Invalid user trying to unlock."; | 246 << "Invalid user trying to unlock."; |
| 247 | 247 |
| 248 authentication_start_time_ = base::Time::Now(); | 248 authentication_start_time_ = base::Time::Now(); |
| 249 delegate_->SetInputEnabled(false); | 249 delegate_->SetInputEnabled(false); |
| 250 delegate_->OnAuthenticate(); | 250 delegate_->OnAuthenticate(); |
| 251 | 251 |
| 252 // Special case: supervised users. Use special authenticator. | 252 // Special case: supervised users. Use special authenticator. |
| 253 if (const User* user = FindUnlockUser(user_context.GetUserID())) { | 253 if (const User* user = FindUnlockUser(user_context.GetUserID())) { |
| 254 if (user->GetType() == User::USER_TYPE_LOCALLY_MANAGED) { | 254 if (user->GetType() == User::USER_TYPE_LOCALLY_MANAGED) { |
| 255 UserContext updated_context = | 255 UserContext updated_context = UserManager::Get() |
| 256 UserManager::Get() | 256 ->GetSupervisedUserManager() |
| 257 ->GetSupervisedUserManager() | 257 ->GetAuthentication() |
| 258 ->GetAuthentication() | 258 ->TransformKey(user_context); |
| 259 ->TransformPasswordInContext(user_context); | |
| 260 // TODO(antrim) : replace empty closure with explicit method. | 259 // TODO(antrim) : replace empty closure with explicit method. |
| 261 // http://crbug.com/351268 | 260 // http://crbug.com/351268 |
| 262 BrowserThread::PostTask( | 261 BrowserThread::PostTask( |
| 263 BrowserThread::UI, | 262 BrowserThread::UI, |
| 264 FROM_HERE, | 263 FROM_HERE, |
| 265 base::Bind(&ExtendedAuthenticator::AuthenticateToCheck, | 264 base::Bind(&ExtendedAuthenticator::AuthenticateToCheck, |
| 266 extended_authenticator_.get(), | 265 extended_authenticator_.get(), |
| 267 updated_context, | 266 updated_context, |
| 268 base::Closure())); | 267 base::Closure())); |
| 269 return; | 268 return; |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 486 | 485 |
| 487 bool ScreenLocker::IsUserLoggedIn(const std::string& username) { | 486 bool ScreenLocker::IsUserLoggedIn(const std::string& username) { |
| 488 for (UserList::const_iterator it = users_.begin(); it != users_.end(); ++it) { | 487 for (UserList::const_iterator it = users_.begin(); it != users_.end(); ++it) { |
| 489 if ((*it)->email() == username) | 488 if ((*it)->email() == username) |
| 490 return true; | 489 return true; |
| 491 } | 490 } |
| 492 return false; | 491 return false; |
| 493 } | 492 } |
| 494 | 493 |
| 495 } // namespace chromeos | 494 } // namespace chromeos |
| OLD | NEW |