| 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 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 void ScreenLocker::UnlockOnLoginSuccess() { | 261 void ScreenLocker::UnlockOnLoginSuccess() { |
| 262 DCHECK(base::MessageLoopForUI::IsCurrent()); | 262 DCHECK(base::MessageLoopForUI::IsCurrent()); |
| 263 if (!authentication_capture_.get()) { | 263 if (!authentication_capture_.get()) { |
| 264 LOG(WARNING) << "Call to UnlockOnLoginSuccess without previous " << | 264 LOG(WARNING) << "Call to UnlockOnLoginSuccess without previous " << |
| 265 "authentication success."; | 265 "authentication success."; |
| 266 return; | 266 return; |
| 267 } | 267 } |
| 268 | 268 |
| 269 if (login_status_consumer_) { | 269 if (login_status_consumer_) { |
| 270 login_status_consumer_->OnLoginSuccess( | 270 login_status_consumer_->OnLoginSuccess( |
| 271 UserContext(authentication_capture_->user_context.GetUserID(), | 271 authentication_capture_->user_context); |
| 272 authentication_capture_->user_context.GetPassword(), | |
| 273 authentication_capture_->user_context.GetAuthCode(), | |
| 274 authentication_capture_->user_context.GetUserIDHash(), | |
| 275 authentication_capture_->user_context.IsUsingOAuth(), | |
| 276 authentication_capture_->user_context.GetAuthFlow())); | |
| 277 } | 272 } |
| 278 authentication_capture_.reset(); | 273 authentication_capture_.reset(); |
| 279 weak_factory_.InvalidateWeakPtrs(); | 274 weak_factory_.InvalidateWeakPtrs(); |
| 280 | 275 |
| 281 VLOG(1) << "Hiding the lock screen."; | 276 VLOG(1) << "Hiding the lock screen."; |
| 282 chromeos::ScreenLocker::Hide(); | 277 chromeos::ScreenLocker::Hide(); |
| 283 } | 278 } |
| 284 | 279 |
| 285 void ScreenLocker::Authenticate(const UserContext& user_context) { | 280 void ScreenLocker::Authenticate(const UserContext& user_context) { |
| 286 LOG_ASSERT(IsUserLoggedIn(user_context.GetUserID())) | 281 LOG_ASSERT(IsUserLoggedIn(user_context.GetUserID())) |
| (...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 598 | 593 |
| 599 bool ScreenLocker::IsUserLoggedIn(const std::string& username) { | 594 bool ScreenLocker::IsUserLoggedIn(const std::string& username) { |
| 600 for (UserList::const_iterator it = users_.begin(); it != users_.end(); ++it) { | 595 for (UserList::const_iterator it = users_.begin(); it != users_.end(); ++it) { |
| 601 if ((*it)->email() == username) | 596 if ((*it)->email() == username) |
| 602 return true; | 597 return true; |
| 603 } | 598 } |
| 604 return false; | 599 return false; |
| 605 } | 600 } |
| 606 | 601 |
| 607 } // namespace chromeos | 602 } // namespace chromeos |
| OLD | NEW |