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

Unified Diff: chrome/renderer/content_settings_observer.cc

Issue 8773035: Content settings: allow scripts on interstitial pages. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Code review. Created 9 years 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/renderer/content_settings_observer.cc
diff --git a/chrome/renderer/content_settings_observer.cc b/chrome/renderer/content_settings_observer.cc
index 1fcdc201e7ea583f66406b65566d2ae43dcc41f2..04afdf89f8b167924a01d60cd8f84be491fa6cac 100644
--- a/chrome/renderer/content_settings_observer.cc
+++ b/chrome/renderer/content_settings_observer.cc
@@ -94,7 +94,8 @@ ContentSettingsObserver::ContentSettingsObserver(
: content::RenderViewObserver(render_view),
content::RenderViewObserverTracker<ContentSettingsObserver>(render_view),
content_setting_rules_(NULL),
- plugins_temporarily_allowed_(false) {
+ plugins_temporarily_allowed_(false),
+ all_scripts_allowed_(false) {
ClearBlockedContentSettings();
}
@@ -226,6 +227,8 @@ bool ContentSettingsObserver::AllowPlugins(WebFrame* frame,
bool ContentSettingsObserver::AllowScript(WebFrame* frame,
bool enabled_per_settings) {
+ if (all_scripts_allowed_)
+ return true;
if (!enabled_per_settings)
return false;
@@ -255,6 +258,8 @@ bool ContentSettingsObserver::AllowScriptFromSource(
WebFrame* frame,
bool enabled_per_settings,
const WebKit::WebURL& script_url) {
+ if (all_scripts_allowed_)
+ return true;
if (!enabled_per_settings)
return false;
@@ -298,6 +303,10 @@ void ContentSettingsObserver::DidNotAllowScript(WebFrame* frame) {
DidBlockContentType(CONTENT_SETTINGS_TYPE_JAVASCRIPT, std::string());
}
+void ContentSettingsObserver::AllowAllScripts() {
+ all_scripts_allowed_ = true;
+}
+
void ContentSettingsObserver::OnLoadBlockedPlugins() {
plugins_temporarily_allowed_ = true;
}

Powered by Google App Engine
This is Rietveld 408576698