| 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 // Interface for objects providing content setting rules. | 5 // Interface for objects providing content setting rules. |
| 6 | 6 |
| 7 #ifndef CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_PROVIDER_H_ | 7 #ifndef CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_PROVIDER_H_ |
| 8 #define CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_PROVIDER_H_ | 8 #define CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_PROVIDER_H_ |
| 9 #pragma once | 9 #pragma once |
| 10 | 10 |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 | 58 |
| 59 ContentSettingsPattern requesting_url_pattern; | 59 ContentSettingsPattern requesting_url_pattern; |
| 60 ContentSettingsPattern embedding_url_pattern; | 60 ContentSettingsPattern embedding_url_pattern; |
| 61 ContentSetting content_setting; | 61 ContentSetting content_setting; |
| 62 }; | 62 }; |
| 63 | 63 |
| 64 typedef std::vector<Rule> Rules; | 64 typedef std::vector<Rule> Rules; |
| 65 | 65 |
| 66 virtual ~ProviderInterface() {} | 66 virtual ~ProviderInterface() {} |
| 67 | 67 |
| 68 // Returns true whether the content settings provider manages the |
| 69 // |content_type|. |
| 70 virtual bool ContentSettingsTypeIsManaged( |
| 71 ContentSettingsType content_type) = 0; |
| 72 |
| 68 // Returns a single ContentSetting which applies to a given |requesting_url|, | 73 // Returns a single ContentSetting which applies to a given |requesting_url|, |
| 69 // |embedding_url| pair or CONTENT_SETTING_DEFAULT, if no rule applies. For | 74 // |embedding_url| pair or CONTENT_SETTING_DEFAULT, if no rule applies. For |
| 70 // ContentSettingsTypes that require a resource identifier to be specified, | 75 // ContentSettingsTypes that require a resource identifier to be specified, |
| 71 // the |resource_identifier| must be non-empty. | 76 // the |resource_identifier| must be non-empty. |
| 72 // | 77 // |
| 73 // This may be called on any thread. | 78 // This may be called on any thread. |
| 74 virtual ContentSetting GetContentSetting( | 79 virtual ContentSetting GetContentSetting( |
| 75 const GURL& requesting_url, | 80 const GURL& requesting_url, |
| 76 const GURL& embedding_url, | 81 const GURL& embedding_url, |
| 77 ContentSettingsType content_type, | 82 ContentSettingsType content_type, |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 | 120 |
| 116 // Resets all content settings to CONTENT_SETTINGS_DEFAULT. | 121 // Resets all content settings to CONTENT_SETTINGS_DEFAULT. |
| 117 // | 122 // |
| 118 // This should only be called on the UI thread. | 123 // This should only be called on the UI thread. |
| 119 virtual void ResetToDefaults() = 0; | 124 virtual void ResetToDefaults() = 0; |
| 120 }; | 125 }; |
| 121 | 126 |
| 122 } // namespace content_settings | 127 } // namespace content_settings |
| 123 | 128 |
| 124 #endif // CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_PROVIDER_H_ | 129 #endif // CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_PROVIDER_H_ |
| OLD | NEW |