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

Unified Diff: chrome/renderer/content_settings_observer.cc

Issue 1417033010: Adding <keygen> Content Setting (Blink) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@keygen_core
Patch Set: Clean up code. Created 5 years, 1 month 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 1e00b6cb13b413fc408f4680a4760943f5e11a2a..3c1147dd996eaea4fc4d51d1ef932d698f40a243 100644
--- a/chrome/renderer/content_settings_observer.cc
+++ b/chrome/renderer/content_settings_observer.cc
@@ -258,10 +258,10 @@ void ContentSettingsObserver::DidCommitProvisionalLoad(
if (!is_same_page_navigation) {
// Clear "block" flags for the new page. This needs to happen before any of
- // |allowScript()|, |allowScriptFromSource()|, |allowImage()|, or
- // |allowPlugins()| is called for the new page so that these functions can
- // correctly detect that a piece of content flipped from "not blocked" to
- // "blocked".
+ // |allowScript()|, |allowScriptFromSource()|, |allowImage()|,
+ // |allowPlugins()|, or |allowKeygen()| is called for the new page so that
+ // these functions can correctly detect that a piece of content flipped from
+ // "not blocked" to "blocked".
ClearBlockedContentSettings();
temporarily_allowed_plugins_.clear();
}
@@ -349,6 +349,17 @@ bool ContentSettingsObserver::allowIndexedDB(const WebString& name,
return result;
}
+bool ContentSettingsObserver::allowKeygen() {
+ if (is_interstitial_page_)
+ return true;
+
+ WebFrame* frame = render_frame()->GetWebFrame();
+ bool allow = false;
+ Send(new ChromeViewHostMsg_AllowKeygen(
+ routing_id(), GURL(frame->securityOrigin().toString()), &allow));
+ return allow;
+}
+
bool ContentSettingsObserver::allowPlugins(bool enabled_per_settings) {
return enabled_per_settings;
}
@@ -593,6 +604,10 @@ bool ContentSettingsObserver::allowRunningInsecureContent(
return true;
}
+void ContentSettingsObserver::didNotAllowKeygen() {
+ DidBlockContentType(CONTENT_SETTINGS_TYPE_KEYGEN);
+}
+
void ContentSettingsObserver::didNotAllowPlugins() {
DidBlockContentType(CONTENT_SETTINGS_TYPE_PLUGINS);
}

Powered by Google App Engine
This is Rietveld 408576698