Chromium Code Reviews| Index: chrome/browser/signin/signin_manager.cc |
| =================================================================== |
| --- chrome/browser/signin/signin_manager.cc (revision 124311) |
| +++ chrome/browser/signin/signin_manager.cc (working copy) |
| @@ -10,6 +10,7 @@ |
| #include "base/command_line.h" |
| #include "base/string_split.h" |
| #include "base/string_util.h" |
| +#include "chrome/browser/content_settings/cookie_settings.h" |
| #include "chrome/browser/prefs/pref_service.h" |
| #include "chrome/browser/profiles/profile.h" |
| #include "chrome/browser/signin/token_service.h" |
| @@ -24,6 +25,8 @@ |
| const char kGetInfoServicesKey[] = "allServices"; |
| const char kGooglePlusServiceKey[] = "googleme"; |
| +const char kGoogleAccountsUrl[] = "https://accounts.google.com"; |
| + |
| SigninManager::SigninManager() |
| : profile_(NULL), |
| had_two_factor_error_(false), |
| @@ -118,11 +121,19 @@ |
| // Register for token availability. The signin manager will pre-login the |
| // user when the GAIA service token is ready for use. Only do this if we |
| - // are not running in ChomiumOS, since it handles pre-login itself. |
| + // are not running in ChomiumOS, since it handles pre-login itself, and if |
| + // cookies are not disabled for Google accounts. |
| #if !defined(OS_CHROMEOS) |
| + CookieSettings* cookie_settings = |
| + CookieSettings::Factory::GetForProfile(profile_); |
| + if (cookie_settings->IsReadingCookieAllowed(GURL(kGoogleAccountsUrl), |
|
jochen (gone - plz use gerrit)
2012/03/01 08:27:58
IsSettingCookieAllowed is enough. Also, please use
Roger Tawa OOO till Jul 10th
2012/03/01 16:53:36
Done. I added a check against null pointer too.
|
| + GURL("")) && |
| + cookie_settings->IsSettingCookieAllowed(GURL(kGoogleAccountsUrl), |
| + GURL(""))) { |
| registrar_.Add(this, |
| chrome::NOTIFICATION_TOKEN_AVAILABLE, |
| content::Source<TokenService>(profile_->GetTokenService())); |
| + } |
| #endif |
| } |