diff options
author | rogerta@chromium.org <rogerta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-03 00:34:38 +0000 |
---|---|---|
committer | rogerta@chromium.org <rogerta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-03 00:34:38 +0000 |
commit | f760a46207817b91cfa42f4649a90326bef2a327 (patch) | |
tree | f044778b0247238afe123643adcad27e2168d224 | |
parent | 6af364c7c51880fa4dd02307d1fa5d741328961d (diff) | |
download | chromium_src-f760a46207817b91cfa42f4649a90326bef2a327.zip chromium_src-f760a46207817b91cfa42f4649a90326bef2a327.tar.gz chromium_src-f760a46207817b91cfa42f4649a90326bef2a327.tar.bz2 |
Merge 124527 - Pre-login should not set cookies and log the user in of cookies are not
enabled for google accounts.
BUG=None
TEST=Create a new profile. Go to content settings and block all sites from
setting data. Alternatively, block only the https://accounts.google.com from
setting data. Now connect the profile a google account. The browser should
not be logged (i.e. going to gmail should not show the inbox). Looking at
all cookie and site data should show no cookies for accounts.google.com.
Review URL: http://codereview.chromium.org/9549026
TBR=rogerta@chromium.org
Review URL: https://chromiumcodereview.appspot.com/9588004
git-svn-id: svn://svn.chromium.org/chrome/branches/1025/src@124787 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/signin/signin_manager.cc | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/chrome/browser/signin/signin_manager.cc b/chrome/browser/signin/signin_manager.cc index b7cc0bb..fa571a1 100644 --- a/chrome/browser/signin/signin_manager.cc +++ b/chrome/browser/signin/signin_manager.cc @@ -6,6 +6,7 @@ #include "base/command_line.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" @@ -19,6 +20,8 @@ const char kGetInfoEmailKey[] = "email"; +const char kGoogleAccountsUrl[] = "https://accounts.google.com"; + SigninManager::SigninManager() : profile_(NULL), had_two_factor_error_(false), @@ -133,11 +136,18 @@ void SigninManager::StartSignIn(const std::string& username, // 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) - registrar_.Add(this, - chrome::NOTIFICATION_TOKEN_AVAILABLE, - content::Source<TokenService>(profile_->GetTokenService())); + CookieSettings* cookie_settings = + CookieSettings::Factory::GetForProfile(profile_); + if (cookie_settings && + cookie_settings->IsSettingCookieAllowed(GURL(kGoogleAccountsUrl), + GURL(kGoogleAccountsUrl))) { + registrar_.Add(this, + chrome::NOTIFICATION_TOKEN_AVAILABLE, + content::Source<TokenService>(profile_->GetTokenService())); + } #endif } |