OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 // Maps hostnames to custom content settings. Written on the UI thread and read | 5 // Maps hostnames to custom content settings. Written on the UI thread and read |
6 // on any thread. One instance per profile. | 6 // on any thread. One instance per profile. |
7 | 7 |
8 #ifndef CHROME_BROWSER_CONTENT_SETTINGS_HOST_CONTENT_SETTINGS_MAP_H_ | 8 #ifndef CHROME_BROWSER_CONTENT_SETTINGS_HOST_CONTENT_SETTINGS_MAP_H_ |
9 #define CHROME_BROWSER_CONTENT_SETTINGS_HOST_CONTENT_SETTINGS_MAP_H_ | 9 #define CHROME_BROWSER_CONTENT_SETTINGS_HOST_CONTENT_SETTINGS_MAP_H_ |
10 #pragma once | 10 #pragma once |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 ContentSettingsType content_type); | 159 ContentSettingsType content_type); |
160 | 160 |
161 // Detaches the HostContentSettingsMap from all Profile-related objects like | 161 // Detaches the HostContentSettingsMap from all Profile-related objects like |
162 // PrefService. This methods needs to be called before destroying the Profile. | 162 // PrefService. This methods needs to be called before destroying the Profile. |
163 // Afterwards, none of the methods above that should only be called on the UI | 163 // Afterwards, none of the methods above that should only be called on the UI |
164 // thread should be called anymore. | 164 // thread should be called anymore. |
165 void ShutdownOnUIThread(); | 165 void ShutdownOnUIThread(); |
166 | 166 |
167 // content_settings::Observer implementation. | 167 // content_settings::Observer implementation. |
168 virtual void OnContentSettingChanged( | 168 virtual void OnContentSettingChanged( |
169 ContentSettingsPattern primary_pattern, | 169 const ContentSettingsPattern& primary_pattern, |
170 ContentSettingsPattern secondary_pattern, | 170 const ContentSettingsPattern& secondary_pattern, |
171 ContentSettingsType content_type, | 171 ContentSettingsType content_type, |
172 std::string resource_identifier) OVERRIDE; | 172 std::string resource_identifier) OVERRIDE; |
173 | 173 |
174 // Returns true if we should allow all content types for this URL. This is | 174 // Returns true if we should allow all content types for this URL. This is |
175 // true for various internal objects like chrome:// URLs, so UI and other | 175 // true for various internal objects like chrome:// URLs, so UI and other |
176 // things users think of as "not webpages" don't break. | 176 // things users think of as "not webpages" don't break. |
177 static bool ShouldAllowAllContent(const GURL& primary_url, | 177 static bool ShouldAllowAllContent(const GURL& primary_url, |
178 const GURL& secondary_url, | 178 const GURL& secondary_url, |
179 ContentSettingsType content_type); | 179 ContentSettingsType content_type); |
180 | 180 |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 // Content setting providers. | 223 // Content setting providers. |
224 ProviderMap content_settings_providers_; | 224 ProviderMap content_settings_providers_; |
225 | 225 |
226 // Used around accesses to the following objects to guarantee thread safety. | 226 // Used around accesses to the following objects to guarantee thread safety. |
227 mutable base::Lock lock_; | 227 mutable base::Lock lock_; |
228 | 228 |
229 DISALLOW_COPY_AND_ASSIGN(HostContentSettingsMap); | 229 DISALLOW_COPY_AND_ASSIGN(HostContentSettingsMap); |
230 }; | 230 }; |
231 | 231 |
232 #endif // CHROME_BROWSER_CONTENT_SETTINGS_HOST_CONTENT_SETTINGS_MAP_H_ | 232 #endif // CHROME_BROWSER_CONTENT_SETTINGS_HOST_CONTENT_SETTINGS_MAP_H_ |
OLD | NEW |