| 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 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 } | 140 } |
| 141 | 141 |
| 142 return true; | 142 return true; |
| 143 } | 143 } |
| 144 | 144 |
| 145 bool CanPerformEarlyRestart() { | 145 bool CanPerformEarlyRestart() { |
| 146 // Desktop build is used for development only. Early restart is not supported. | 146 // Desktop build is used for development only. Early restart is not supported. |
| 147 if (!base::SysInfo::IsRunningOnChromeOS()) | 147 if (!base::SysInfo::IsRunningOnChromeOS()) |
| 148 return false; | 148 return false; |
| 149 | 149 |
| 150 if (!ChromeUserManager::Get()->GetCurrentUserFlow()-> |
| 151 SupportsEarlyRestartToApplyFlags()) { |
| 152 return false; |
| 153 } |
| 154 |
| 150 const ExistingUserController* controller = | 155 const ExistingUserController* controller = |
| 151 ExistingUserController::current_controller(); | 156 ExistingUserController::current_controller(); |
| 152 if (!controller) | 157 if (!controller) |
| 153 return true; | 158 return true; |
| 154 | 159 |
| 155 // Early restart is possible only if OAuth token is up to date. | 160 // Early restart is possible only if OAuth token is up to date. |
| 156 | 161 |
| 157 if (controller->password_changed()) | 162 if (controller->password_changed()) |
| 158 return false; | 163 return false; |
| 159 | 164 |
| (...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 489 CrosSettings* cros_settings = CrosSettings::Get(); | 494 CrosSettings* cros_settings = CrosSettings::Get(); |
| 490 bool allow_new_user = false; | 495 bool allow_new_user = false; |
| 491 cros_settings->GetBoolean(kAccountsPrefAllowNewUser, &allow_new_user); | 496 cros_settings->GetBoolean(kAccountsPrefAllowNewUser, &allow_new_user); |
| 492 if (allow_new_user) | 497 if (allow_new_user) |
| 493 return true; | 498 return true; |
| 494 return cros_settings->FindEmailInList( | 499 return cros_settings->FindEmailInList( |
| 495 kAccountsPrefUsers, username, wildcard_match); | 500 kAccountsPrefUsers, username, wildcard_match); |
| 496 } | 501 } |
| 497 | 502 |
| 498 } // namespace chromeos | 503 } // namespace chromeos |
| OLD | NEW |