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

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: 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..4a3dede8759d4b83c4366435f4db87ec39481ce6 100644
--- a/chrome/renderer/content_settings_observer.cc
+++ b/chrome/renderer/content_settings_observer.cc
@@ -6,6 +6,7 @@
#include "chrome/common/render_messages.h"
#include "chrome/common/url_constants.h"
+#include "content/common/view_messages.h"
#include "content/public/renderer/document_state.h"
#include "content/public/renderer/navigation_state.h"
#include "content/public/renderer/render_view.h"
@@ -94,7 +95,8 @@ ContentSettingsObserver::ContentSettingsObserver(
: content::RenderViewObserver(render_view),
content::RenderViewObserverTracker<ContentSettingsObserver>(render_view),
content_setting_rules_(NULL),
- plugins_temporarily_allowed_(false) {
+ plugins_temporarily_allowed_(false),
+ is_interstitial_page_(false) {
ClearBlockedContentSettings();
}
@@ -127,6 +129,7 @@ bool ContentSettingsObserver::OnMessageReceived(const IPC::Message& message) {
// blocked plugin.
IPC_MESSAGE_HANDLER_GENERIC(ChromeViewMsg_LoadBlockedPlugins,
OnLoadBlockedPlugins(); handled = false)
+ IPC_MESSAGE_HANDLER(ViewMsg_SetAsInterstitial, OnSetAsInterstitial)
jochen (gone - plz use gerrit) 2011/12/02 12:38:08 I think the render view impl should handle the mes
marja 2011/12/02 14:39:34 Done.
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
return handled;
@@ -226,6 +229,8 @@ bool ContentSettingsObserver::AllowPlugins(WebFrame* frame,
bool ContentSettingsObserver::AllowScript(WebFrame* frame,
bool enabled_per_settings) {
+ if (is_interstitial_page_)
+ return true;
if (!enabled_per_settings)
return false;
@@ -255,6 +260,8 @@ bool ContentSettingsObserver::AllowScriptFromSource(
WebFrame* frame,
bool enabled_per_settings,
const WebKit::WebURL& script_url) {
+ if (is_interstitial_page_)
+ return true;
if (!enabled_per_settings)
return false;
@@ -302,6 +309,10 @@ void ContentSettingsObserver::OnLoadBlockedPlugins() {
plugins_temporarily_allowed_ = true;
}
+void ContentSettingsObserver::OnSetAsInterstitial() {
+ is_interstitial_page_ = true;
+}
+
void ContentSettingsObserver::ClearBlockedContentSettings() {
for (size_t i = 0; i < arraysize(content_blocked_); ++i)
content_blocked_[i] = false;

Powered by Google App Engine
This is Rietveld 408576698