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

Unified Diff: chrome/renderer/content_settings_observer.h

Issue 8409006: Take script URLs into account when applying script content settings. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Code review. 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
« no previous file with comments | « chrome/renderer/chrome_render_view_observer.cc ('k') | chrome/renderer/content_settings_observer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/content_settings_observer.h
diff --git a/chrome/renderer/content_settings_observer.h b/chrome/renderer/content_settings_observer.h
index acff53b001feaecb51afdc3ac6f3cdb2aa7b3f18..dd9c7b9c44f51693353d812d6e267722498c7f92 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.
Bernhard Bauer 2011/11/08 09:32:52 This comment is not accurate anymore. In fact, I t
marja 2011/11/08 09:39:35 Ahh, true, I'll create another CL for removing thi
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];
« no previous file with comments | « chrome/renderer/chrome_render_view_observer.cc ('k') | chrome/renderer/content_settings_observer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698