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

Unified Diff: chrome/browser/ui/chrome_pages.cc

Issue 12088040: Add a SigninAllowed policy. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add tests and link UpdateLogin to kSigninAllowed pref. 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/ui/chrome_pages.cc
diff --git a/chrome/browser/ui/chrome_pages.cc b/chrome/browser/ui/chrome_pages.cc
index 9255140465d05bc515f18c0bde5b6497c8354931..fe73c53b1ccc723e01fa1a7eded1b5ef34a98727 100644
--- a/chrome/browser/ui/chrome_pages.cc
+++ b/chrome/browser/ui/chrome_pages.cc
@@ -10,6 +10,7 @@
#include "chrome/browser/download/download_shelf.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/signin/signin_manager.h"
+#include "chrome/browser/signin/signin_manager_factory.h"
#include "chrome/browser/sync/profile_sync_service.h"
#include "chrome/browser/sync/profile_sync_service_factory.h"
#include "chrome/browser/ui/browser.h"
@@ -184,6 +185,10 @@ void ShowSearchEngineSettings(Browser* browser) {
void ShowBrowserSignin(Browser* browser, SyncPromoUI::Source source) {
Profile* original_profile = browser->profile()->GetOriginalProfile();
+ // Check if Signin to Chrome is allowed by the policy.
+ SigninManager* signin = SigninManagerFactory::GetForProfile(original_profile);
+ if (!signin->IsSigninAllowed())
+ return;
ProfileSyncService* service =
ProfileSyncServiceFactory::GetInstance()->GetForProfile(
original_profile);

Powered by Google App Engine
This is Rietveld 408576698