Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(401)

Side by Side Diff: chrome/browser/chromeos/login/login_utils.cc

Issue 654173005: Don't allow restarting to apply custom flags when supervised user creation flow is active (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698