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

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

Issue 14367029: Introduce SigninManagerDelegate and use to eliminate CookieSettings dependency. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge LKGR Created 7 years, 8 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/signin/chrome_signin_manager_delegate.cc
diff --git a/chrome/browser/signin/chrome_signin_manager_delegate.cc b/chrome/browser/signin/chrome_signin_manager_delegate.cc
new file mode 100644
index 0000000000000000000000000000000000000000..2b63603ec07fb63ca214feafa769c6035387e17a
--- /dev/null
+++ b/chrome/browser/signin/chrome_signin_manager_delegate.cc
@@ -0,0 +1,41 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/signin/chrome_signin_manager_delegate.h"
+
+#include "chrome/browser/content_settings/cookie_settings.h"
+#include "googleurl/src/gurl.h"
+
+namespace {
+
+const char kGoogleAccountsUrl[] = "https://accounts.google.com";
+
+} // namespace
+
+ChromeSigninManagerDelegate::ChromeSigninManagerDelegate(Profile* profile)
+ : profile_(profile) {
+}
+
+ChromeSigninManagerDelegate::~ChromeSigninManagerDelegate() {
+}
+
+// static
+bool ChromeSigninManagerDelegate::ProfileAllowsSigninCookies(Profile* profile) {
+ CookieSettings* cookie_settings =
+ CookieSettings::Factory::GetForProfile(profile);
+ return SettingsAllowSigninCookies(cookie_settings);
+}
+
+// static
+bool ChromeSigninManagerDelegate::SettingsAllowSigninCookies(
+ CookieSettings* cookie_settings) {
+ return cookie_settings &&
+ cookie_settings->IsSettingCookieAllowed(GURL(kGoogleAccountsUrl),
+ GURL(kGoogleAccountsUrl));
+}
+
+
+bool ChromeSigninManagerDelegate::AreSigninCookiesAllowed() {
+ return ProfileAllowsSigninCookies(profile_);
+}
« no previous file with comments | « chrome/browser/signin/chrome_signin_manager_delegate.h ('k') | chrome/browser/signin/fake_signin_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698