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

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: Oops, adding tests killed by the previous 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 beabcd712057bc040d17696bc4f99742d393b09e..246d831bf05644e46a13d2ad0e8fc0327771ad7a 100644
--- a/chrome/renderer/content_settings_observer.cc
+++ b/chrome/renderer/content_settings_observer.cc
@@ -68,7 +68,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();
}
@@ -162,6 +163,8 @@ bool ContentSettingsObserver::AllowFileSystem(WebFrame* frame) {
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::AllowPlugins(WebFrame* frame,
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 @@ 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;
@@ -272,6 +279,10 @@ void ContentSettingsObserver::DidNotAllowScript(WebFrame* frame) {
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