diff options
author | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-09 23:25:49 +0000 |
---|---|---|
committer | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-09 23:25:49 +0000 |
commit | da0c8e9e4c51699ef08ee449fe83fc1fb24b773d (patch) | |
tree | 671475593d2a739ed91dae72e631173ddd6219eb /chrome/browser/host_content_settings_map.h | |
parent | 42da24d2930b8c2257f3560366a8eff766d8fb9b (diff) | |
download | chromium_src-da0c8e9e4c51699ef08ee449fe83fc1fb24b773d.zip chromium_src-da0c8e9e4c51699ef08ee449fe83fc1fb24b773d.tar.gz chromium_src-da0c8e9e4c51699ef08ee449fe83fc1fb24b773d.tar.bz2 |
Whitelist all content for various internal schemes.
BUG=34805
TEST=New Tab page should still work if you disable script + images
Review URL: http://codereview.chromium.org/588011
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38536 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/host_content_settings_map.h')
-rw-r--r-- | chrome/browser/host_content_settings_map.h | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/chrome/browser/host_content_settings_map.h b/chrome/browser/host_content_settings_map.h index 509fa9d..4b4e141 100644 --- a/chrome/browser/host_content_settings_map.h +++ b/chrome/browser/host_content_settings_map.h @@ -17,6 +17,7 @@ #include "base/lock.h" #include "base/ref_counted.h" #include "chrome/common/content_settings.h" +#include "googleurl/src/gurl.h" class DictionaryValue; class PrefService; @@ -32,7 +33,7 @@ class HostContentSettingsMap // each host. class ContentSettingsDetails { public: - ContentSettingsDetails(const std::string& host) : host_(host) {} + explicit 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_; } @@ -60,11 +61,20 @@ class HostContentSettingsMap ContentSetting GetContentSetting(const std::string& host, ContentSettingsType content_type) const; + // Same as above, but for a URL instead of a host. The difference is that + // URLs with particular internal schemes are whitelisted. + ContentSetting GetContentSetting(const GURL& url, + ContentSettingsType content_type) const; + // Returns all ContentSettings which apply to a given host. // // This may be called on any thread. ContentSettings GetContentSettings(const std::string& host) const; + // Same as above, but for a URL instead of a host. The difference is that + // URLs with particular internal schemes are whitelisted. + ContentSettings GetContentSettings(const GURL& url) const; + // For a given content type, returns all hosts with a non-default setting, // mapped to their actual settings, in lexicographical order. |settings| must // be a non-NULL outparam. @@ -119,6 +129,11 @@ class HostContentSettingsMap ~HostContentSettingsMap(); + // Returns true if we should allow all content types for this URL. This is + // true for various internal objects like chrome:// URLs, so UI and other + // things users think of as "not webpages" don't break. + static bool ShouldAllowAllContent(const GURL& url); + // Sets the fields of |settings| based on the values in |dictionary|. void GetSettingsFromDictionary(const DictionaryValue* dictionary, ContentSettings* settings); |