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

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: Fixing profile_io_data use in chrome_render_message_filter 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..2acdd7300a03795e9645dc03b55850b6a6016cf9 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,23 @@ bool ContentSettingsObserver::allowIndexedDB(const WebString& name,
return result;
}
+bool ContentSettingsObserver::allowKeygen() {
+ if (is_interstitial_page_)
+ return true;
+
+ WebFrame* frame = render_frame()->GetWebFrame();
+ std::map<WebFrame*, bool>::const_iterator it =
+ cached_keygen_permissions_.find(frame);
+ if (it != cached_keygen_permissions_.end())
jochen (gone - plz use gerrit) 2015/11/07 05:53:29 do you expect that this happens so often that it's
svaldez 2015/11/10 15:23:41 Done.
+ return it->second;
+
+ bool allow = false;
+ Send(new ChromeViewHostMsg_AllowKeygen(
+ routing_id(), GURL(frame->securityOrigin().toString()), &allow));
+ cached_keygen_permissions_[frame] = allow;
+ return allow;
+}
+
bool ContentSettingsObserver::allowPlugins(bool enabled_per_settings) {
return enabled_per_settings;
}
@@ -593,6 +610,10 @@ bool ContentSettingsObserver::allowRunningInsecureContent(
return true;
}
+void ContentSettingsObserver::didNotAllowKeygen() {
+ DidBlockContentType(CONTENT_SETTINGS_TYPE_KEYGEN);
+}
+
void ContentSettingsObserver::didNotAllowPlugins() {
DidBlockContentType(CONTENT_SETTINGS_TYPE_PLUGINS);
}
@@ -654,6 +675,7 @@ void ContentSettingsObserver::ClearBlockedContentSettings() {
content_blocked_.clear();
cached_storage_permissions_.clear();
cached_script_permissions_.clear();
+ cached_keygen_permissions_.clear();
}
bool ContentSettingsObserver::IsPlatformApp() {

Powered by Google App Engine
This is Rietveld 408576698