 Chromium Code Reviews
 Chromium Code Reviews Issue 6253012:
  Add ContentSettingsProvider Interface.  (Closed) 
  Base URL: svn://svn.chromium.org/chrome/trunk/src
    
  
    Issue 6253012:
  Add ContentSettingsProvider Interface.  (Closed) 
  Base URL: svn://svn.chromium.org/chrome/trunk/src| 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 e791eaddade8f36ac72730fd3a733fcc4805e030..bdf54a63161cf2d61709723968b1ca313bba9340 100644 | 
| --- a/chrome/browser/content_settings/content_settings_provider.h | 
| +++ b/chrome/browser/content_settings/content_settings_provider.h | 
| @@ -8,8 +8,17 @@ | 
| #define CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_PROVIDER_H_ | 
| #pragma once | 
| +#include <string> | 
| +#include <utility> | 
| +#include <vector> | 
| + | 
| +#include "chrome/browser/content_settings/content_settings_pattern.h" | 
| #include "chrome/common/content_settings.h" | 
| +class GURL; | 
| + | 
| +namespace content_settings { | 
| + | 
| class DefaultContentSettingsProvider { | 
| public: | 
| virtual ~DefaultContentSettingsProvider() {} | 
| @@ -39,4 +48,56 @@ class DefaultContentSettingsProvider { | 
| ContentSettingsType content_type) const = 0; | 
| }; | 
| +struct ContentSettingsRule { | 
| + ContentSettingsRule() {} | 
| + ContentSettingsRule(const ContentSettingsPattern& requesting_url_pattern, | 
| + const ContentSettingsPattern& embedding_url_pattern, | 
| + ContentSetting& setting) | 
| + : requesting_url_pattern_(requesting_url_pattern), | 
| 
Bernhard Bauer
2011/01/27 09:54:26
Nit: The colon should be indented four spaces w/r/
 
markusheintz_
2011/01/27 10:24:37
Done.
 | 
| + 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<ContentSettingsRule> ContentSettingsRules; | 
| + | 
| +class ContentSettingsProvider { | 
| + public: | 
| + typedef std::string ResourceIdentifier; | 
| + | 
| + virtual ~ContentSettingsProvider() {} | 
| + | 
| + virtual bool ContentSettingsTypeIsManaged( | 
| + ContentSettingsType content_type) = 0; | 
| + | 
| + // 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, | 
| + ContentSettingsRules* 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_ |