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

Side by Side Diff: components/signin/core/browser/signin_manager.cc

Issue 2547083004: Fix Check failure in ProfileManager when force-sign-in is enabled and last used profile is supervis… (Closed)
Patch Set: Created 4 years 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
« no previous file with comments | « chrome/browser/signin/chrome_signin_client.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "components/signin/core/browser/signin_manager.h" 5 #include "components/signin/core/browser/signin_manager.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/metrics/histogram_macros.h" 10 #include "base/metrics/histogram_macros.h"
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
262 SignOut(signin_metrics::GOOGLE_SERVICE_NAME_PATTERN_CHANGED, 262 SignOut(signin_metrics::GOOGLE_SERVICE_NAME_PATTERN_CHANGED,
263 signin_metrics::SignoutDelete::IGNORE_METRIC); 263 signin_metrics::SignoutDelete::IGNORE_METRIC);
264 } 264 }
265 } 265 }
266 266
267 bool SigninManager::IsSigninAllowed() const { 267 bool SigninManager::IsSigninAllowed() const {
268 return signin_allowed_.GetValue(); 268 return signin_allowed_.GetValue();
269 } 269 }
270 270
271 void SigninManager::OnSigninAllowedPrefChanged() { 271 void SigninManager::OnSigninAllowedPrefChanged() {
272 if (!IsSigninAllowed()) 272 if (!IsSigninAllowed() && (IsAuthenticated() || AuthInProgress()))
273 SignOut(signin_metrics::SIGNOUT_PREF_CHANGED, 273 SignOut(signin_metrics::SIGNOUT_PREF_CHANGED,
274 signin_metrics::SignoutDelete::IGNORE_METRIC); 274 signin_metrics::SignoutDelete::IGNORE_METRIC);
275 } 275 }
276 276
277 // static 277 // static
278 bool SigninManager::IsUsernameAllowedByPolicy(const std::string& username, 278 bool SigninManager::IsUsernameAllowedByPolicy(const std::string& username,
279 const std::string& policy) { 279 const std::string& policy) {
280 if (policy.empty()) 280 if (policy.empty())
281 return true; 281 return true;
282 282
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
424 account_tracker_service()->SetMigrationDone(); 424 account_tracker_service()->SetMigrationDone();
425 token_service_->RemoveObserver(this); 425 token_service_->RemoveObserver(this);
426 } 426 }
427 } 427 }
428 428
429 void SigninManager::ProhibitSignout(bool prohibit_signout) { 429 void SigninManager::ProhibitSignout(bool prohibit_signout) {
430 prohibit_signout_ = prohibit_signout; 430 prohibit_signout_ = prohibit_signout;
431 } 431 }
432 432
433 bool SigninManager::IsSignoutProhibited() const { return prohibit_signout_; } 433 bool SigninManager::IsSignoutProhibited() const { return prohibit_signout_; }
OLDNEW
« no previous file with comments | « chrome/browser/signin/chrome_signin_client.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698