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, | |
85 ContentSetting setting); | |
86 | 84 |
87 // Resets the cookie setting for the given url. | 85 // Resets the cookie setting for the given url. |
88 // | 86 // |
89 // This should only be called on the UI thread. | 87 // This should only be called on the UI thread. |
90 void ResetCookieSetting(const GURL& primary_url); | 88 void ResetCookieSetting(const GURL& primary_url); |
91 | 89 |
92 bool IsStorageDurable(const GURL& origin) const; | 90 bool IsStorageDurable(const GURL& origin) const; |
93 | 91 |
94 // Detaches the |CookieSettings| from |PrefService|. This methods needs to be | 92 // Detaches the |CookieSettings| from |PrefService|. This methods needs to be |
95 // called before destroying the service. Afterwards, only const methods can be | 93 // called before destroying the service. Afterwards, only const methods can be |
(...skipping 29 matching lines...) Expand all Loading... |
125 mutable base::Lock lock_; | 123 mutable base::Lock lock_; |
126 | 124 |
127 bool block_third_party_cookies_; | 125 bool block_third_party_cookies_; |
128 | 126 |
129 DISALLOW_COPY_AND_ASSIGN(CookieSettings); | 127 DISALLOW_COPY_AND_ASSIGN(CookieSettings); |
130 }; | 128 }; |
131 | 129 |
132 } // namespace content_settings | 130 } // namespace content_settings |
133 | 131 |
134 #endif // COMPONENTS_CONTENT_SETTINGS_CORE_BROWSER_COOKIE_SETTINGS_H_ | 132 #endif // COMPONENTS_CONTENT_SETTINGS_CORE_BROWSER_COOKIE_SETTINGS_H_ |
OLD | NEW |