| 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 COMPONENTS_CONTENT_SETTINGS_CORE_BROWSER_COOKIE_SETTINGS_H_ | 5 #ifndef COMPONENTS_CONTENT_SETTINGS_CORE_BROWSER_COOKIE_SETTINGS_H_ |
| 6 #define COMPONENTS_CONTENT_SETTINGS_CORE_BROWSER_COOKIE_SETTINGS_H_ | 6 #define COMPONENTS_CONTENT_SETTINGS_CORE_BROWSER_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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 // | 70 // |
| 71 // This may be called on any thread. | 71 // This may be called on any thread. |
| 72 void GetCookieSettings(ContentSettingsForOneType* settings) const; | 72 void GetCookieSettings(ContentSettingsForOneType* settings) const; |
| 73 | 73 |
| 74 // Sets the default content setting (CONTENT_SETTING_ALLOW, | 74 // Sets the default content setting (CONTENT_SETTING_ALLOW, |
| 75 // CONTENT_SETTING_BLOCK, or CONTENT_SETTING_SESSION_ONLY) for cookies. | 75 // CONTENT_SETTING_BLOCK, or CONTENT_SETTING_SESSION_ONLY) for cookies. |
| 76 // | 76 // |
| 77 // This should only be called on the UI thread. | 77 // This should only be called on the UI thread. |
| 78 void SetDefaultCookieSetting(ContentSetting setting); | 78 void SetDefaultCookieSetting(ContentSetting setting); |
| 79 | 79 |
| 80 // Sets the cookie setting for the given patterns. | 80 // Sets the cookie setting for the given url. |
| 81 // | 81 // |
| 82 // This should only be called on the UI thread. | 82 // This should only be called on the UI thread. |
| 83 void SetCookieSetting(const ContentSettingsPattern& primary_pattern, | 83 void SetCookieSetting(const GURL& primary_url, ContentSetting setting); |
| 84 const ContentSettingsPattern& secondary_pattern, | 84 |
| 85 ContentSetting setting); | 85 // Sets the cookie setting for the given patterns. Developers will generally |
| 86 // want to use SetCookieSetting() unless they need to specify custom scoping. |
| 87 // |
| 88 // This should only be called on the UI thread. |
| 89 void SetCookieException(const ContentSettingsPattern& primary_pattern, |
| 90 const ContentSettingsPattern& secondary_pattern, |
| 91 ContentSetting setting); |
| 86 | 92 |
| 87 // Resets the cookie setting for the given patterns. | 93 // Resets the cookie setting for the given patterns. |
| 88 // | 94 // |
| 89 // This should only be called on the UI thread. | 95 // This should only be called on the UI thread. |
| 90 void ResetCookieSetting(const ContentSettingsPattern& primary_pattern, | 96 void ResetCookieSetting(const ContentSettingsPattern& primary_pattern, |
| 91 const ContentSettingsPattern& secondary_pattern); | 97 const ContentSettingsPattern& secondary_pattern); |
| 92 | 98 |
| 93 bool IsStorageDurable(const GURL& origin) const; | 99 bool IsStorageDurable(const GURL& origin) const; |
| 94 | 100 |
| 95 // Detaches the |CookieSettings| from |PrefService|. This methods needs to be | 101 // Detaches the |CookieSettings| from |PrefService|. This methods needs to be |
| (...skipping 30 matching lines...) Expand all Loading... |
| 126 mutable base::Lock lock_; | 132 mutable base::Lock lock_; |
| 127 | 133 |
| 128 bool block_third_party_cookies_; | 134 bool block_third_party_cookies_; |
| 129 | 135 |
| 130 DISALLOW_COPY_AND_ASSIGN(CookieSettings); | 136 DISALLOW_COPY_AND_ASSIGN(CookieSettings); |
| 131 }; | 137 }; |
| 132 | 138 |
| 133 } // namespace content_settings | 139 } // namespace content_settings |
| 134 | 140 |
| 135 #endif // COMPONENTS_CONTENT_SETTINGS_CORE_BROWSER_COOKIE_SETTINGS_H_ | 141 #endif // COMPONENTS_CONTENT_SETTINGS_CORE_BROWSER_COOKIE_SETTINGS_H_ |
| OLD | NEW |