| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/screen_locker.h" | 5 #include "chrome/browser/chromeos/login/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 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 GoogleServiceSigninSuccessDetails details( | 220 GoogleServiceSigninSuccessDetails details( |
| 221 signin->GetAuthenticatedUsername(), | 221 signin->GetAuthenticatedUsername(), |
| 222 user_context.password); | 222 user_context.password); |
| 223 content::NotificationService::current()->Notify( | 223 content::NotificationService::current()->Notify( |
| 224 chrome::NOTIFICATION_GOOGLE_SIGNIN_SUCCESSFUL, | 224 chrome::NOTIFICATION_GOOGLE_SIGNIN_SUCCESSFUL, |
| 225 content::Source<Profile>(profile), | 225 content::Source<Profile>(profile), |
| 226 content::Details<const GoogleServiceSigninSuccessDetails>(&details)); | 226 content::Details<const GoogleServiceSigninSuccessDetails>(&details)); |
| 227 } | 227 } |
| 228 } | 228 } |
| 229 | 229 |
| 230 if (const User* user = UserManager::Get()->FindUser(user_context.username)) { | 230 if (!UserManager::Get()->FindUser(user_context.username)) |
| 231 if (!user->is_active()) | |
| 232 UserManager::Get()->SwitchActiveUser(user_context.username); | |
| 233 } else { | |
| 234 NOTREACHED() << "Logged in user not found."; | 231 NOTREACHED() << "Logged in user not found."; |
| 235 } | |
| 236 | 232 |
| 237 authentication_capture_.reset(new AuthenticationParametersCapture()); | 233 authentication_capture_.reset(new AuthenticationParametersCapture()); |
| 238 authentication_capture_->user_context = user_context; | 234 authentication_capture_->user_context = user_context; |
| 239 | 235 |
| 240 // Add guard for case when something get broken in call chain to unlock | 236 // Add guard for case when something get broken in call chain to unlock |
| 241 // for sure. | 237 // for sure. |
| 242 base::MessageLoop::current()->PostDelayedTask( | 238 base::MessageLoop::current()->PostDelayedTask( |
| 243 FROM_HERE, | 239 FROM_HERE, |
| 244 base::Bind(&ScreenLocker::UnlockOnLoginSuccess, | 240 base::Bind(&ScreenLocker::UnlockOnLoginSuccess, |
| 245 weak_factory_.GetWeakPtr()), | 241 weak_factory_.GetWeakPtr()), |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 448 | 444 |
| 449 bool ScreenLocker::IsUserLoggedIn(const std::string& username) { | 445 bool ScreenLocker::IsUserLoggedIn(const std::string& username) { |
| 450 for (UserList::const_iterator it = users_.begin(); it != users_.end(); ++it) { | 446 for (UserList::const_iterator it = users_.begin(); it != users_.end(); ++it) { |
| 451 if ((*it)->email() == username) | 447 if ((*it)->email() == username) |
| 452 return true; | 448 return true; |
| 453 } | 449 } |
| 454 return false; | 450 return false; |
| 455 } | 451 } |
| 456 | 452 |
| 457 } // namespace chromeos | 453 } // namespace chromeos |
| OLD | NEW |