summaryrefslogtreecommitdiffstats
path: root/chrome/renderer/content_settings_observer.h
diff options
context:
space:
mode:
authormarja@chromium.org <marja@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-09 10:02:45 +0000
committermarja@chromium.org <marja@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-09 10:02:45 +0000
commitfa775cf16c88fbf3176df7724b2009d62869c361 (patch)
tree2b553465d8b32a1d231bda70d55bdc0317196612 /chrome/renderer/content_settings_observer.h
parent4db9f28275062950f16dcce294aee6a66f84c6f3 (diff)
downloadchromium_src-fa775cf16c88fbf3176df7724b2009d62869c361.zip
chromium_src-fa775cf16c88fbf3176df7724b2009d62869c361.tar.gz
chromium_src-fa775cf16c88fbf3176df7724b2009d62869c361.tar.bz2
Take script URLs into account when applying script content settings.
Transmit script content settings to the renderer. Use the script URL as the secondary URL for the content setting rules. BUG=90840 TEST=ChromeRenderViewTest.ContentSettings(Allow|Block)Scripts Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=109005 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=109036 Review URL: http://codereview.chromium.org/8409006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@109213 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/content_settings_observer.h')
-rw-r--r--chrome/renderer/content_settings_observer.h19
1 files changed, 11 insertions, 8 deletions
diff --git a/chrome/renderer/content_settings_observer.h b/chrome/renderer/content_settings_observer.h
index acff53b..dd9c7b9 100644
--- a/chrome/renderer/content_settings_observer.h
+++ b/chrome/renderer/content_settings_observer.h
@@ -34,11 +34,11 @@ class ContentSettingsObserver
// allowPlugins().
void SetDefaultContentSettings(const ContentSettings* settings);
- // Sets the image setting rules which back |allowImage()|. The
- // |ContentSettingsForOneType| object must outlive this
+ // Sets the content setting rules which back |AllowImage()|, |AllowScript()|,
+ // and |AllowScriptFromSource()|. |content_setting_rules| must outlive this
// |ContentSettingsObserver|.
- void SetImageSettingRules(
- const ContentSettingsForOneType* image_setting_rules);
+ void SetContentSettingRules(
+ const RendererContentSettingRules* content_setting_rules);
// Returns the setting for the given type.
ContentSetting GetContentSetting(ContentSettingsType type);
@@ -68,6 +68,8 @@ class ContentSettingsObserver
const WebKit::WebSecurityOrigin& origin);
bool AllowPlugins(WebKit::WebFrame* frame, bool enabled_per_settings);
bool AllowScript(WebKit::WebFrame* frame, bool enabled_per_settings);
+ bool AllowScriptFromSource(WebKit::WebFrame* frame, bool enabled_per_settings,
+ const WebKit::WebURL& script_url);
bool AllowStorage(WebKit::WebFrame* frame, bool local);
void DidNotAllowPlugins(WebKit::WebFrame* frame);
void DidNotAllowScript(WebKit::WebFrame* frame);
@@ -102,10 +104,11 @@ class ContentSettingsObserver
// Stores if loading of scripts and plugins is allowed.
ContentSettings current_content_settings_;
- // Stores the rules for image content settings. Normally, they are owned by
- // |ChromeRenderProcessObserver|. In the tests they are owned by the caller of
- // |SetImageSettingRules|.
- const ContentSettingsForOneType* image_setting_rules_;
+ // A pointer to content setting rules stored by the renderer. Normally, the
+ // |RendererContentSettingRules| object is owned by
+ // |ChromeRenderProcessObserver|. In the tests it is owned by the caller of
+ // |SetContentSettingRules|.
+ const RendererContentSettingRules* content_setting_rules_;
// Stores if images, scripts, and plugins have actually been blocked.
bool content_blocked_[CONTENT_SETTINGS_NUM_TYPES];