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

Unified Diff: chrome/browser/signin/signin_manager.cc

Issue 9549026: Pre-login should not set cookies and log the user in of cookies are not (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Fix indent Created 8 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/signin/signin_manager.cc
===================================================================
--- chrome/browser/signin/signin_manager.cc (revision 124412)
+++ 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,18 @@
// 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
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698