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 "chrome/browser/content_settings/cookie_settings.h" | 5 #include "chrome/browser/content_settings/cookie_settings.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "chrome/browser/content_settings/content_settings_utils.h" | 8 #include "chrome/browser/content_settings/content_settings_utils.h" |
9 #include "chrome/browser/content_settings/host_content_settings_map.h" | 9 #include "chrome/browser/content_settings/host_content_settings_map.h" |
10 #include "chrome/browser/prefs/pref_service.h" | 10 #include "chrome/browser/prefs/pref_service.h" |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 } | 63 } |
64 | 64 |
65 CookieSettings::Factory::~Factory() {} | 65 CookieSettings::Factory::~Factory() {} |
66 | 66 |
67 void CookieSettings::Factory::RegisterUserPrefs(PrefService* user_prefs) { | 67 void CookieSettings::Factory::RegisterUserPrefs(PrefService* user_prefs) { |
68 user_prefs->RegisterBooleanPref(prefs::kBlockThirdPartyCookies, | 68 user_prefs->RegisterBooleanPref(prefs::kBlockThirdPartyCookies, |
69 false, | 69 false, |
70 PrefService::SYNCABLE_PREF); | 70 PrefService::SYNCABLE_PREF); |
71 } | 71 } |
72 | 72 |
73 bool CookieSettings::Factory::ServiceRedirectedInIncognito() { | 73 bool CookieSettings::Factory::ServiceRedirectedInIncognito() const { |
74 return true; | 74 return true; |
75 } | 75 } |
76 | 76 |
77 scoped_refptr<RefcountedProfileKeyedService> | 77 scoped_refptr<RefcountedProfileKeyedService> |
78 CookieSettings::Factory::BuildServiceInstanceFor(Profile* profile) const { | 78 CookieSettings::Factory::BuildServiceInstanceFor(Profile* profile) const { |
79 return new CookieSettings(profile->GetHostContentSettingsMap(), | 79 return new CookieSettings(profile->GetHostContentSettingsMap(), |
80 profile->GetPrefs()); | 80 profile->GetPrefs()); |
81 } | 81 } |
82 | 82 |
83 CookieSettings::CookieSettings( | 83 CookieSettings::CookieSettings( |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 DCHECK(value.get()); | 223 DCHECK(value.get()); |
224 return content_settings::ValueToContentSetting(value.get()); | 224 return content_settings::ValueToContentSetting(value.get()); |
225 } | 225 } |
226 | 226 |
227 CookieSettings::~CookieSettings() {} | 227 CookieSettings::~CookieSettings() {} |
228 | 228 |
229 bool CookieSettings::ShouldBlockThirdPartyCookies() const { | 229 bool CookieSettings::ShouldBlockThirdPartyCookies() const { |
230 base::AutoLock auto_lock(lock_); | 230 base::AutoLock auto_lock(lock_); |
231 return block_third_party_cookies_; | 231 return block_third_party_cookies_; |
232 } | 232 } |
OLD | NEW |