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

Unified Diff: chrome/browser/ui/webui/ntp/ntp_login_handler.cc

Issue 12088040: Add a SigninAllowed policy. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Extract managed user specific stuff into another changelist. 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/webui/ntp/ntp_login_handler.cc
diff --git a/chrome/browser/ui/webui/ntp/ntp_login_handler.cc b/chrome/browser/ui/webui/ntp/ntp_login_handler.cc
index ab788a1e6010a5d9ca332270efaa3f75ac4767f1..b7d06b3c1b5d2560ae60a454d1b7d999de4d622b 100644
--- a/chrome/browser/ui/webui/ntp/ntp_login_handler.cc
+++ b/chrome/browser/ui/webui/ntp/ntp_login_handler.cc
@@ -91,6 +91,10 @@ void NTPLoginHandler::RegisterMessages() {
pref_service,
base::Bind(&NTPLoginHandler::UpdateLogin,
base::Unretained(this)));
+ signin_allowed_pref_.Init(prefs::kSigninAllowed,
+ pref_service,
+ base::Bind(&NTPLoginHandler::UpdateLogin,
+ base::Unretained(this)));
registrar_.Add(this, chrome::NOTIFICATION_PROFILE_CACHED_INFO_CHANGED,
content::NotificationService::AllSources());
@@ -250,7 +254,7 @@ bool NTPLoginHandler::ShouldShow(Profile* profile) {
// UI and the avatar menu don't exist on that platform.
return false;
#else
- return !profile->IsOffTheRecord();
+ return !profile->IsOffTheRecord() && profile->IsSigninAllowed();
#endif
}

Powered by Google App Engine
This is Rietveld 408576698