Chromium Code Reviews| Index: chrome/browser/content_settings/content_settings_provider.h |
| diff --git a/chrome/browser/content_settings/content_settings_provider.h b/chrome/browser/content_settings/content_settings_provider.h |
| index b330db82d922028e5fbaa1945dae9dc6606f2909..8936ecf2592c80252b0dce609a1973afa25f0a09 100644 |
| --- a/chrome/browser/content_settings/content_settings_provider.h |
| +++ b/chrome/browser/content_settings/content_settings_provider.h |
| @@ -8,8 +8,14 @@ |
| #define CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_PROVIDER_H_ |
| #pragma once |
| +#include <string> |
| +#include <vector> |
| + |
| +#include "chrome/browser/content_settings/content_settings_pattern.h" |
| #include "chrome/common/content_settings.h" |
| +class GURL; |
| + |
| namespace content_settings { |
| class DefaultProviderInterface { |
| @@ -41,6 +47,56 @@ class DefaultProviderInterface { |
| ContentSettingsType content_type) const = 0; |
| }; |
| +class ProviderInterface { |
| + public: |
| + typedef std::string ResourceIdentifier; |
| + |
| + struct Rule { |
| + Rule() {} |
| + Rule(const ContentSettingsPattern& requesting_url_pattern, |
| + const ContentSettingsPattern& embedding_url_pattern, |
| + ContentSetting& setting) |
| + : requesting_url_pattern_(requesting_url_pattern), |
| + embedding_url_pattern_(embedding_url_pattern), |
| + content_setting_(setting) {} |
| + |
| + const ContentSettingsPattern requesting_url_pattern_; |
| + const ContentSettingsPattern embedding_url_pattern_; |
| + ContentSetting content_setting_; |
| + }; |
| + |
| + typedef std::vector<Rule> Rules; |
| + |
| + virtual ~ProviderInterface() {} |
| + |
| + virtual bool ContentSettingsTypeIsManaged( |
| + ContentSettingsType content_type) = 0; |
|
Bernhard Bauer
2011/01/31 13:48:58
Do we need this? What level of strictness does man
markusheintz_
2011/01/31 14:21:19
Actually I think we could get rid of this.
jochen (gone - plz use gerrit)
2011/01/31 14:30:02
If an provider returns true here, the user's setti
|
| + |
| + // This may be called on any thread. |
| + virtual ContentSetting GetContentSetting( |
| + const GURL requesting_url, |
| + const GURL embedding_url, |
| + const ContentSettingsType& content_type, |
| + const ResourceIdentifier& resource_identifier) const = 0; |
| + |
| + // This should only be called on the UI thread. |
| + virtual void SetContentSetting( |
| + const ContentSettingsPattern& requesting_pattern, |
| + const ContentSettingsPattern& embedding_pattern, |
| + const ContentSettingsType& content_type, |
| + const ResourceIdentifier& resource_identifier, |
| + ContentSetting content_setting) = 0; |
| + |
| + // This may be called on any thread. |
| + virtual void GetAllContentSettingsRules( |
| + const ContentSettingsType& content_type, |
| + const ResourceIdentifier& resource_identifier, |
| + Rules* content_setting_rules) const = 0; |
| + |
| + // This should only be called on the UI thread. |
| + virtual void ClearAllContentSettingsRules() = 0; |
| +}; |
| + |
| } // namespace content_settings |
| #endif // CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_PROVIDER_H_ |