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

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

Issue 8539004: Replace SetContentSetting method of the content_settings::Provider interface with GetWebsiteSetting (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: " Created 9 years, 1 month 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/host_content_settings_map.h
diff --git a/chrome/browser/content_settings/host_content_settings_map.h b/chrome/browser/content_settings/host_content_settings_map.h
index 7c91008cf11ebb264e527656b993b48d4fc25fc7..bd8336e8adf7a2fa858046b782100821d545ec42 100644
--- a/chrome/browser/content_settings/host_content_settings_map.h
+++ b/chrome/browser/content_settings/host_content_settings_map.h
@@ -17,6 +17,7 @@
#include "base/memory/ref_counted.h"
#include "base/synchronization/lock.h"
#include "base/tuple.h"
+#include "base/values.h"
Bernhard Bauer 2011/11/11 14:00:40 Why do you need this header? base::Value is alread
markusheintz_ 2011/11/14 11:15:10 Done.
#include "chrome/browser/content_settings/content_settings_observer.h"
#include "chrome/browser/prefs/pref_change_registrar.h"
#include "chrome/common/content_settings.h"
@@ -135,6 +136,19 @@ class HostContentSettingsMap
const std::string& resource_identifier,
ContentSetting setting);
+ // Sets the |value| for the given patterns and content type. Setting the
+ // value to NULL causes the default value for that type to be used when
+ // loading pages matching this pattern. For ContentSettingsTypes that require
Bernhard Bauer 2011/11/11 14:00:40 Urgh, that comment is outdated :( If you're suffer
markusheintz_ 2011/11/14 11:15:10 Done.
+ // an resource identifier to be specified, the |resource_identifier| must be
+ // non-empty.
+ //
+ // Takes ownership of the passed value.
+ void SetWebsiteSetting(const ContentSettingsPattern& primary_pattern,
+ const ContentSettingsPattern& secondary_pattern,
+ ContentSettingsType content_type,
+ const std::string& resource_identifier,
+ base::Value* value);
+
// Convenience method to add a content setting for the given URLs, making sure
// that there is no setting overriding it. For ContentSettingsTypes that
// require an resource identifier to be specified, the |resource_identifier|
@@ -152,6 +166,8 @@ class HostContentSettingsMap
// This should only be called on the UI thread.
void ClearSettingsForOneType(ContentSettingsType content_type);
+ static bool IsValueAllowedForType(const base::Value* value,
+ ContentSettingsType content_type);
static bool IsSettingAllowedForType(ContentSetting setting,
ContentSettingsType content_type);

Powered by Google App Engine
This is Rietveld 408576698