OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/signin/chrome_signin_manager_delegate.h" | 5 #include "chrome/browser/signin/chrome_signin_manager_delegate.h" |
6 | 6 |
7 #include "chrome/browser/content_settings/cookie_settings.h" | 7 #include "chrome/browser/content_settings/cookie_settings.h" |
8 #include "googleurl/src/gurl.h" | 8 #include "googleurl/src/gurl.h" |
9 | 9 |
10 namespace { | 10 namespace { |
11 | 11 |
12 const char kGoogleAccountsUrl[] = "https://accounts.google.com"; | 12 const char kGoogleAccountsUrl[] = "https://accounts.google.com"; |
13 | 13 |
14 } // namespace | 14 } // namespace |
15 | 15 |
16 ChromeSigninManagerDelegate::ChromeSigninManagerDelegate(Profile* profile) | 16 ChromeSigninManagerDelegate::ChromeSigninManagerDelegate(Profile* profile) |
17 : profile_(profile) { | 17 : profile_(profile) { |
18 } | 18 } |
19 | 19 |
20 ChromeSigninManagerDelegate::~ChromeSigninManagerDelegate() { | 20 ChromeSigninManagerDelegate::~ChromeSigninManagerDelegate() { |
21 } | 21 } |
22 | 22 |
23 // static | 23 // static |
24 bool ChromeSigninManagerDelegate::ProfileAllowsSigninCookies(Profile* profile) { | 24 bool ChromeSigninManagerDelegate::ProfileAllowsSigninCookies(Profile* profile) { |
25 CookieSettings* cookie_settings = | 25 CookieSettings* cookie_settings = |
26 CookieSettings::Factory::GetForProfile(profile); | 26 CookieSettings::Factory::GetForProfile(profile).get(); |
27 return SettingsAllowSigninCookies(cookie_settings); | 27 return SettingsAllowSigninCookies(cookie_settings); |
28 } | 28 } |
29 | 29 |
30 // static | 30 // static |
31 bool ChromeSigninManagerDelegate::SettingsAllowSigninCookies( | 31 bool ChromeSigninManagerDelegate::SettingsAllowSigninCookies( |
32 CookieSettings* cookie_settings) { | 32 CookieSettings* cookie_settings) { |
33 return cookie_settings && | 33 return cookie_settings && |
34 cookie_settings->IsSettingCookieAllowed(GURL(kGoogleAccountsUrl), | 34 cookie_settings->IsSettingCookieAllowed(GURL(kGoogleAccountsUrl), |
35 GURL(kGoogleAccountsUrl)); | 35 GURL(kGoogleAccountsUrl)); |
36 } | 36 } |
37 | 37 |
38 | 38 |
39 bool ChromeSigninManagerDelegate::AreSigninCookiesAllowed() { | 39 bool ChromeSigninManagerDelegate::AreSigninCookiesAllowed() { |
40 return ProfileAllowsSigninCookies(profile_); | 40 return ProfileAllowsSigninCookies(profile_); |
41 } | 41 } |
OLD | NEW |