| 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 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 // content_settings::Observer implementation. | 160 // content_settings::Observer implementation. |
| 161 virtual void OnContentSettingChanged( | 161 virtual void OnContentSettingChanged( |
| 162 ContentSettingsPattern primary_pattern, | 162 ContentSettingsPattern primary_pattern, |
| 163 ContentSettingsPattern secondary_pattern, | 163 ContentSettingsPattern secondary_pattern, |
| 164 ContentSettingsType content_type, | 164 ContentSettingsType content_type, |
| 165 std::string resource_identifier); | 165 std::string resource_identifier); |
| 166 | 166 |
| 167 // Returns true if we should allow all content types for this URL. This is | 167 // Returns true if we should allow all content types for this URL. This is |
| 168 // true for various internal objects like chrome:// URLs, so UI and other | 168 // true for various internal objects like chrome:// URLs, so UI and other |
| 169 // things users think of as "not webpages" don't break. | 169 // things users think of as "not webpages" don't break. |
| 170 static bool ShouldAllowAllContent(const GURL& url, | 170 static bool ShouldAllowAllContent(const GURL& first_party_url, |
| 171 const GURL& url, |
| 171 ContentSettingsType content_type); | 172 ContentSettingsType content_type); |
| 172 | 173 |
| 173 private: | 174 private: |
| 174 friend class base::RefCountedThreadSafe<HostContentSettingsMap>; | 175 friend class base::RefCountedThreadSafe<HostContentSettingsMap>; |
| 175 friend class HostContentSettingsMapTest_NonDefaultSettings_Test; | 176 friend class HostContentSettingsMapTest_NonDefaultSettings_Test; |
| 176 | 177 |
| 177 typedef std::map<ProviderType, content_settings::ProviderInterface*> | 178 typedef std::map<ProviderType, content_settings::ProviderInterface*> |
| 178 ProviderMap; | 179 ProviderMap; |
| 179 typedef ProviderMap::iterator ProviderIterator; | 180 typedef ProviderMap::iterator ProviderIterator; |
| 180 typedef ProviderMap::const_iterator ConstProviderIterator; | 181 typedef ProviderMap::const_iterator ConstProviderIterator; |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 // Content setting providers. | 216 // Content setting providers. |
| 216 ProviderMap content_settings_providers_; | 217 ProviderMap content_settings_providers_; |
| 217 | 218 |
| 218 // Used around accesses to the following objects to guarantee thread safety. | 219 // Used around accesses to the following objects to guarantee thread safety. |
| 219 mutable base::Lock lock_; | 220 mutable base::Lock lock_; |
| 220 | 221 |
| 221 DISALLOW_COPY_AND_ASSIGN(HostContentSettingsMap); | 222 DISALLOW_COPY_AND_ASSIGN(HostContentSettingsMap); |
| 222 }; | 223 }; |
| 223 | 224 |
| 224 #endif // CHROME_BROWSER_CONTENT_SETTINGS_HOST_CONTENT_SETTINGS_MAP_H_ | 225 #endif // CHROME_BROWSER_CONTENT_SETTINGS_HOST_CONTENT_SETTINGS_MAP_H_ |
| OLD | NEW |