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/login_utils.h" | 5 #include "chrome/browser/chromeos/login/login_utils.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <set> | 8 #include <set> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 return true; | 157 return true; |
158 | 158 |
159 // Early restart is possible only if OAuth token is up to date. | 159 // Early restart is possible only if OAuth token is up to date. |
160 | 160 |
161 if (controller->password_changed()) | 161 if (controller->password_changed()) |
162 return false; | 162 return false; |
163 | 163 |
164 if (controller->auth_mode() != LoginPerformer::AUTH_MODE_INTERNAL) | 164 if (controller->auth_mode() != LoginPerformer::AUTH_MODE_INTERNAL) |
165 return false; | 165 return false; |
166 | 166 |
| 167 // No early restart if Easy unlock key needs to be updated. |
| 168 if (UserSessionManager::GetInstance()->NeedsToUpdateEasyUnlockKeys()) |
| 169 return false; |
| 170 |
167 return true; | 171 return true; |
168 } | 172 } |
169 | 173 |
170 } // namespace | 174 } // namespace |
171 | 175 |
172 class LoginUtilsImpl : public LoginUtils, | 176 class LoginUtilsImpl : public LoginUtils, |
173 public base::SupportsWeakPtr<LoginUtilsImpl>, | 177 public base::SupportsWeakPtr<LoginUtilsImpl>, |
174 public UserSessionManagerDelegate { | 178 public UserSessionManagerDelegate { |
175 public: | 179 public: |
176 LoginUtilsImpl() | 180 LoginUtilsImpl() |
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
446 } | 450 } |
447 | 451 |
448 #if defined(ENABLE_RLZ) | 452 #if defined(ENABLE_RLZ) |
449 void LoginUtilsImpl::OnRlzInitialized() { | 453 void LoginUtilsImpl::OnRlzInitialized() { |
450 if (delegate_) | 454 if (delegate_) |
451 delegate_->OnRlzInitialized(); | 455 delegate_->OnRlzInitialized(); |
452 } | 456 } |
453 #endif | 457 #endif |
454 | 458 |
455 void LoginUtilsImpl::AttemptRestart(Profile* profile) { | 459 void LoginUtilsImpl::AttemptRestart(Profile* profile) { |
| 460 if (UserSessionManager::GetInstance() |
| 461 ->CheckEasyUnlockKeyOps( |
| 462 base::Bind(&LoginUtilsImpl::AttemptRestart, |
| 463 base::Unretained(this), |
| 464 profile))) { |
| 465 return; |
| 466 } |
| 467 |
456 if (UserSessionManager::GetInstance()->GetSigninSessionRestoreStrategy() != | 468 if (UserSessionManager::GetInstance()->GetSigninSessionRestoreStrategy() != |
457 OAuth2LoginManager::RESTORE_FROM_COOKIE_JAR) { | 469 OAuth2LoginManager::RESTORE_FROM_COOKIE_JAR) { |
458 chrome::AttemptRestart(); | 470 chrome::AttemptRestart(); |
459 return; | 471 return; |
460 } | 472 } |
461 | 473 |
462 // We can't really quit if the session restore process that mints new | 474 // We can't really quit if the session restore process that mints new |
463 // refresh token is still in progress. | 475 // refresh token is still in progress. |
464 OAuth2LoginManager* login_manager = | 476 OAuth2LoginManager* login_manager = |
465 OAuth2LoginManagerFactory::GetInstance()->GetForProfile(profile); | 477 OAuth2LoginManagerFactory::GetInstance()->GetForProfile(profile); |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
497 CrosSettings* cros_settings = CrosSettings::Get(); | 509 CrosSettings* cros_settings = CrosSettings::Get(); |
498 bool allow_new_user = false; | 510 bool allow_new_user = false; |
499 cros_settings->GetBoolean(kAccountsPrefAllowNewUser, &allow_new_user); | 511 cros_settings->GetBoolean(kAccountsPrefAllowNewUser, &allow_new_user); |
500 if (allow_new_user) | 512 if (allow_new_user) |
501 return true; | 513 return true; |
502 return cros_settings->FindEmailInList( | 514 return cros_settings->FindEmailInList( |
503 kAccountsPrefUsers, username, wildcard_match); | 515 kAccountsPrefUsers, username, wildcard_match); |
504 } | 516 } |
505 | 517 |
506 } // namespace chromeos | 518 } // namespace chromeos |
OLD | NEW |