| 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 #ifndef CHROME_BROWSER_CONTENT_SETTINGS_COOKIE_SETTINGS_H_ | 5 #ifndef CHROME_BROWSER_CONTENT_SETTINGS_COOKIE_SETTINGS_H_ |
| 6 #define CHROME_BROWSER_CONTENT_SETTINGS_COOKIE_SETTINGS_H_ | 6 #define CHROME_BROWSER_CONTENT_SETTINGS_COOKIE_SETTINGS_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 static Factory* GetInstance(); | 114 static Factory* GetInstance(); |
| 115 | 115 |
| 116 private: | 116 private: |
| 117 friend struct DefaultSingletonTraits<Factory>; | 117 friend struct DefaultSingletonTraits<Factory>; |
| 118 | 118 |
| 119 Factory(); | 119 Factory(); |
| 120 virtual ~Factory(); | 120 virtual ~Factory(); |
| 121 | 121 |
| 122 // |ProfileKeyedBaseFactory| methods: | 122 // |ProfileKeyedBaseFactory| methods: |
| 123 virtual void RegisterUserPrefs(PrefRegistrySyncable* registry) OVERRIDE; | 123 virtual void RegisterUserPrefs(PrefRegistrySyncable* registry) OVERRIDE; |
| 124 virtual bool ServiceRedirectedInIncognito() const OVERRIDE; | 124 virtual content::BrowserContext* GetBrowserContextToUse( |
| 125 content::BrowserContext* context) const OVERRIDE; |
| 125 virtual scoped_refptr<RefcountedProfileKeyedService> | 126 virtual scoped_refptr<RefcountedProfileKeyedService> |
| 126 BuildServiceInstanceFor( | 127 BuildServiceInstanceFor( |
| 127 content::BrowserContext* context) const OVERRIDE; | 128 content::BrowserContext* context) const OVERRIDE; |
| 128 }; | 129 }; |
| 129 | 130 |
| 130 private: | 131 private: |
| 131 virtual ~CookieSettings(); | 132 virtual ~CookieSettings(); |
| 132 | 133 |
| 133 void OnBlockThirdPartyCookiesChanged(); | 134 void OnBlockThirdPartyCookiesChanged(); |
| 134 | 135 |
| 135 // Returns true if the "block third party cookies" preference is set. | 136 // Returns true if the "block third party cookies" preference is set. |
| 136 // | 137 // |
| 137 // This method may be called on any thread. | 138 // This method may be called on any thread. |
| 138 bool ShouldBlockThirdPartyCookies() const; | 139 bool ShouldBlockThirdPartyCookies() const; |
| 139 | 140 |
| 140 scoped_refptr<HostContentSettingsMap> host_content_settings_map_; | 141 scoped_refptr<HostContentSettingsMap> host_content_settings_map_; |
| 141 PrefChangeRegistrar pref_change_registrar_; | 142 PrefChangeRegistrar pref_change_registrar_; |
| 142 | 143 |
| 143 // Used around accesses to |block_third_party_cookies_| to guarantee thread | 144 // Used around accesses to |block_third_party_cookies_| to guarantee thread |
| 144 // safety. | 145 // safety. |
| 145 mutable base::Lock lock_; | 146 mutable base::Lock lock_; |
| 146 | 147 |
| 147 bool block_third_party_cookies_; | 148 bool block_third_party_cookies_; |
| 148 }; | 149 }; |
| 149 | 150 |
| 150 #endif // CHROME_BROWSER_CONTENT_SETTINGS_COOKIE_SETTINGS_H_ | 151 #endif // CHROME_BROWSER_CONTENT_SETTINGS_COOKIE_SETTINGS_H_ |
| OLD | NEW |