| 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 7062aad3fb1b76b87b2a2e3699edcc8f83c2a5dd..55955ac60b86e49152046d8a5e365b3b90ee1827 100644
|
| --- a/chrome/browser/ui/webui/ntp/ntp_login_handler.cc
|
| +++ b/chrome/browser/ui/webui/ntp/ntp_login_handler.cc
|
| @@ -20,6 +20,8 @@
|
| #include "chrome/browser/profiles/profile_info_cache.h"
|
| #include "chrome/browser/profiles/profile_manager.h"
|
| #include "chrome/browser/profiles/profile_metrics.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"
|
| @@ -91,6 +93,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 +256,8 @@ bool NTPLoginHandler::ShouldShow(Profile* profile) {
|
| // UI and the avatar menu don't exist on that platform.
|
| return false;
|
| #else
|
| - return !profile->IsOffTheRecord();
|
| + SigninManager* signin = SigninManagerFactory::GetForProfile(profile);
|
| + return !profile->IsOffTheRecord() && signin && signin->IsSigninAllowed();
|
| #endif
|
| }
|
|
|
|
|