summaryrefslogtreecommitdiffstats
path: root/chrome/browser/host_content_settings_map.h
diff options
context:
space:
mode:
authorthakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-02 02:36:25 +0000
committerthakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-02 02:36:25 +0000
commit79580c6f2f13f43b4735b7e982570fbe779a40ea (patch)
treeaa96dcad2a8614c8083acfa482da2ae650a06030 /chrome/browser/host_content_settings_map.h
parentcabe39c43a98b6b635951d5cb3649e061e36ea21 (diff)
downloadchromium_src-79580c6f2f13f43b4735b7e982570fbe779a40ea.zip
chromium_src-79580c6f2f13f43b4735b7e982570fbe779a40ea.tar.gz
chromium_src-79580c6f2f13f43b4735b7e982570fbe779a40ea.tar.bz2
Send a message to the renderers when content settings change.
BUG=32719 TEST=none Review URL: http://codereview.chromium.org/551225 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@37788 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/host_content_settings_map.h')
-rw-r--r--chrome/browser/host_content_settings_map.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/chrome/browser/host_content_settings_map.h b/chrome/browser/host_content_settings_map.h
index 658225a..509fa9d 100644
--- a/chrome/browser/host_content_settings_map.h
+++ b/chrome/browser/host_content_settings_map.h
@@ -25,6 +25,22 @@ class Profile;
class HostContentSettingsMap
: public base::RefCountedThreadSafe<HostContentSettingsMap> {
public:
+ // Details for the CONTENT_SETTINGS_CHANGED notification. This is sent when
+ // content settings change for at least one host. If settings change for more
+ // than one host in one user interaction, this will usually send a single
+ // notification with a wildcard host field instead of one notification for
+ // each host.
+ class ContentSettingsDetails {
+ public:
+ ContentSettingsDetails(const std::string& host) : host_(host) {}
+ // The host whose settings have changed. Empty if many hosts are affected
+ // (e.g. if the default settings have changed).
+ const std::string& host() { return host_; }
+
+ private:
+ std::string host_;
+ };
+
typedef std::pair<std::string, ContentSetting> HostSettingPair;
typedef std::vector<HostSettingPair> SettingsForOneType;
@@ -114,6 +130,12 @@ class HostContentSettingsMap
// Returns true if |settings| consists entirely of CONTENT_SETTING_DEFAULT.
bool AllDefault(const ContentSettings& settings) const;
+ // Informs observers that content settings have changed. Make sure that
+ // |lock_| is not held when calling this, as listeners will usually call one
+ // of the GetSettings functions in response, which would then lead to a
+ // mutex deadlock.
+ void NotifyObservers(const std::string& host);
+
// The profile we're associated with.
Profile* profile_;