OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "components/content_settings/core/browser/cookie_settings.h" | 5 #include "components/content_settings/core/browser/cookie_settings.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
10 #include "components/content_settings/core/browser/content_settings_utils.h" | 10 #include "components/content_settings/core/browser/content_settings_utils.h" |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 } | 68 } |
69 | 69 |
70 bool CookieSettings::IsCookieSessionOnly(const GURL& origin) const { | 70 bool CookieSettings::IsCookieSessionOnly(const GURL& origin) const { |
71 ContentSetting setting = GetCookieSetting(origin, origin, true, NULL); | 71 ContentSetting setting = GetCookieSetting(origin, origin, true, NULL); |
72 DCHECK(IsValidSetting(setting)); | 72 DCHECK(IsValidSetting(setting)); |
73 return (setting == CONTENT_SETTING_SESSION_ONLY); | 73 return (setting == CONTENT_SETTING_SESSION_ONLY); |
74 } | 74 } |
75 | 75 |
76 void CookieSettings::GetCookieSettings( | 76 void CookieSettings::GetCookieSettings( |
77 ContentSettingsForOneType* settings) const { | 77 ContentSettingsForOneType* settings) const { |
78 // TODO(dgrogan): Why is this returning a value in a void function? | 78 host_content_settings_map_->GetSettingsForOneType( |
79 return host_content_settings_map_->GetSettingsForOneType( | |
80 CONTENT_SETTINGS_TYPE_COOKIES, std::string(), settings); | 79 CONTENT_SETTINGS_TYPE_COOKIES, std::string(), settings); |
81 } | 80 } |
82 | 81 |
83 void CookieSettings::RegisterProfilePrefs( | 82 void CookieSettings::RegisterProfilePrefs( |
84 user_prefs::PrefRegistrySyncable* registry) { | 83 user_prefs::PrefRegistrySyncable* registry) { |
85 registry->RegisterBooleanPref( | 84 registry->RegisterBooleanPref( |
86 prefs::kBlockThirdPartyCookies, false, | 85 prefs::kBlockThirdPartyCookies, false, |
87 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); | 86 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); |
88 } | 87 } |
89 | 88 |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 block_third_party_cookies_ = pref_change_registrar_.prefs()->GetBoolean( | 178 block_third_party_cookies_ = pref_change_registrar_.prefs()->GetBoolean( |
180 prefs::kBlockThirdPartyCookies); | 179 prefs::kBlockThirdPartyCookies); |
181 } | 180 } |
182 | 181 |
183 bool CookieSettings::ShouldBlockThirdPartyCookies() const { | 182 bool CookieSettings::ShouldBlockThirdPartyCookies() const { |
184 base::AutoLock auto_lock(lock_); | 183 base::AutoLock auto_lock(lock_); |
185 return block_third_party_cookies_; | 184 return block_third_party_cookies_; |
186 } | 185 } |
187 | 186 |
188 } // namespace content_settings | 187 } // namespace content_settings |
OLD | NEW |