Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5379)

Unified Diff: chrome/browser/content_settings/content_settings_provider.h

Issue 6253012: Add ContentSettingsProvider Interface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..879eb0d780fb0ae1aa34485c769d6be5ada07933 100644
--- a/chrome/browser/content_settings/content_settings_provider.h
+++ b/chrome/browser/content_settings/content_settings_provider.h
@@ -8,8 +8,21 @@
#define CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_PROVIDER_H_
#pragma once
+#include "chrome/browser/content_settings/content_identifier.h"
+#include "chrome/browser/content_settings/content_settings_rule.h"
+#include "chrome/browser/content_settings/host.h"
+#include "chrome/browser/content_settings/host_pattern.h"
Bernhard Bauer 2011/01/26 10:25:18 If these are classes, I guess you could just forwa
markusheintz_ 2011/01/26 15:27:08 Will fix when clear which of this classes stay.
#include "chrome/common/content_settings.h"
+using content_settings::ContentIdentifier;
Bernhard Bauer 2011/01/26 10:25:18 We don't use namespace imports in header files, on
markusheintz_ 2011/01/26 15:27:08 I put the ContentSettingsProvider in the content_s
+using content_settings::ContentSettingsRule;
+using content_settings::ContentSettingsRulePtr;
+using content_settings::ContentSettingsRules;
+using content_settings::Host;
+using content_settings::HostPattern;
+
+class GURL;
+
class DefaultContentSettingsProvider {
public:
virtual ~DefaultContentSettingsProvider() {}
@@ -39,4 +52,39 @@ class DefaultContentSettingsProvider {
ContentSettingsType content_type) const = 0;
};
+class ContentSettingsProvider {
jochen (gone - plz use gerrit) 2011/01/26 11:29:18 public: missing
markusheintz_ 2011/01/26 15:27:08 Done.
+ virtual ~ContentSettingsProvider() {}
jochen (gone - plz use gerrit) 2011/01/26 11:29:18 where is isManaged, isReadOnly, and canProvide? P
Bernhard Bauer 2011/01/26 11:34:23 We don't need it anymore with the new interface :)
markusheintz_ 2011/01/26 15:27:08 Don't need them. I think the enum should live in
+
+ // Returns the ContentSetting for the given |host| and |content_identifier|.
+ //
Bernhard Bauer 2011/01/26 10:25:18 Nit: remove empty comment lines.
markusheintz_ 2011/01/26 15:27:08 Done.
+ // This may be called on any thread.
+ virtual ContentSetting GetContentSetting(
+ const Host& host,
+ const ContentIdentifier& content_identifier) const = 0;
+
+ // Sets the |content_setting| for the given |host| and |content_identifier|.
+ // Setting the value to CONTENT_SETTING_DEFAULT causes the default setting for
+ // that type to be used when loading pages matching this pattern.
+ //
+ // This should only be called on the UI thread.
+ virtual void SetContentSetting(
+ const Host& host,
Bernhard Bauer 2011/01/26 10:25:18 Should this take a pattern?
markusheintz_ 2011/01/26 15:27:08 of course! :) done
+ const ContentIdentifier& content_identifier,
+ ContentSetting content_setting) = 0;
+
+ // For the given |content_identifier| return all content-setting-rules with a
+ // non-default setting.
+ //
+ // This may be called on any thread.
+ virtual void GetAllContentSettingsRules(
+ const ContentIdentifier& content_identifier,
+ ContentSettingsRules* content_setting_rules) const = 0;
+
+ // Clears all content-setting-rules for the given |content_identifier|.
+ //
+ // This should only be called on the UI thread.
+ virtual void ClearAllContentSettingsRules(
+ const ContentIdentifier& content_identifier) = 0;
+};
+
#endif // CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_PROVIDER_H_

Powered by Google App Engine
This is Rietveld 408576698