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

Unified Diff: chrome/browser/signin/signin_ui_util.cc

Issue 12088040: Add a SigninAllowed policy. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Some bugfixes. Created 7 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/signin/signin_ui_util.cc
diff --git a/chrome/browser/signin/signin_ui_util.cc b/chrome/browser/signin/signin_ui_util.cc
index 61bd7306057c6fed97fbada9f8b148c6cae19f6c..350ded0367b3609b946fc400cc4507542f4d63eb 100644
--- a/chrome/browser/signin/signin_ui_util.cc
+++ b/chrome/browser/signin/signin_ui_util.cc
@@ -38,7 +38,7 @@ GlobalError* GetSignedInServiceError(Profile* profile) {
// No auth error - now try other services. Currently the list is just hard-
// coded but in the future if we add more we can create some kind of
// registration framework.
- if (profile->IsSyncAccessible()) {
+ if (profile->IsSyncAccessible() && profile->IsSigninAllowed()) {
Andrew T Wilson (Slow) 2013/02/04 15:41:48 Don't check IsSigninAllowed() here.
Adrian Kuegel 2013/02/05 10:55:15 Done.
ProfileSyncService* service =
ProfileSyncServiceFactory::GetForProfile(profile);
SyncGlobalError* error = service->sync_global_error();
@@ -54,8 +54,9 @@ string16 GetSigninMenuLabel(Profile* profile) {
return error->MenuItemLabel();
// No errors, so just display the signed in user, if any.
- ProfileSyncService* service = profile->IsSyncAccessible() ?
- ProfileSyncServiceFactory::GetForProfile(profile) : NULL;
+ ProfileSyncService* service =
+ profile->IsSyncAccessible() && profile->IsSigninAllowed() ?
Andrew T Wilson (Slow) 2013/02/04 15:41:48 Don't check IsSigninAllowed() here.
Adrian Kuegel 2013/02/05 10:55:15 Done.
+ ProfileSyncServiceFactory::GetForProfile(profile) : NULL;
// Even if the user is signed in, don't display the "signed in as..."
// label if we're still setting up sync.

Powered by Google App Engine
This is Rietveld 408576698