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; |
} |