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

Unified Diff: chrome/renderer/content_settings_observer.cc

Issue 8873015: Revert 113591 - Revert 113579 - Content settings: allow scripts on interstitial pages even if Jav... (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
===================================================================
--- chrome/renderer/content_settings_observer.cc (revision 113593)
+++ chrome/renderer/content_settings_observer.cc (working copy)
@@ -68,7 +68,8 @@
: 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();
}
@@ -162,6 +163,8 @@
bool ContentSettingsObserver::AllowImage(WebFrame* frame,
bool enabled_per_settings,
const WebURL& image_url) {
+ if (is_interstitial_page_)
+ return true;
if (IsWhitelistedForContentSettings(frame))
return true;
@@ -200,6 +203,8 @@
bool ContentSettingsObserver::AllowScript(WebFrame* frame,
bool enabled_per_settings) {
+ if (is_interstitial_page_)
+ return true;
if (!enabled_per_settings)
return false;
@@ -229,6 +234,8 @@
WebFrame* frame,
bool enabled_per_settings,
const WebKit::WebURL& script_url) {
+ if (is_interstitial_page_)
+ return true;
if (!enabled_per_settings)
return false;
@@ -272,6 +279,10 @@
DidBlockContentType(CONTENT_SETTINGS_TYPE_JAVASCRIPT, std::string());
}
+void ContentSettingsObserver::SetAsInterstitial() {
+ is_interstitial_page_ = true;
+}
+
void ContentSettingsObserver::OnLoadBlockedPlugins() {
plugins_temporarily_allowed_ = true;
}
« no previous file with comments | « chrome/renderer/content_settings_observer.h ('k') | chrome/renderer/content_settings_observer_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698