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

Unified Diff: chrome/renderer/render_view.cc

Issue 3074005: Move click-to-play behind the --enable-click-to-play switch. (Closed) Base URL: git://codf21.jail/chromium.git
Patch Set: Created 10 years, 5 months 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
« no previous file with comments | « chrome/renderer/render_view.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/render_view.cc
diff --git a/chrome/renderer/render_view.cc b/chrome/renderer/render_view.cc
index a1147ddb45f58569e7deaecc7c2dbe3a31d32790..817437cfeabcfad91c531f340f1e88b505543b54 100644
--- a/chrome/renderer/render_view.cc
+++ b/chrome/renderer/render_view.cc
@@ -2196,10 +2196,13 @@ WebPlugin* RenderView::createPlugin(WebFrame* frame,
if (path.value().empty())
return NULL;
- if (!AllowContentType(CONTENT_SETTINGS_TYPE_PLUGINS) &&
- path.value() != kDefaultPluginLibraryName) {
- didNotAllowPlugins(frame);
- return CreatePluginPlaceholder(frame, params);
+ if (CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kEnableClickToPlay)) {
+ if (!AllowContentType(CONTENT_SETTINGS_TYPE_PLUGINS) &&
+ path.value() != kDefaultPluginLibraryName) {
+ didNotAllowPlugins(frame);
+ return CreatePluginPlaceholder(frame, params);
+ }
}
return CreatePluginInternal(frame, params, actual_mime_type, path);
}
@@ -2331,6 +2334,16 @@ bool RenderView::allowImages(WebFrame* frame, bool enabled_per_settings) {
return false; // Other protocols fall through here.
}
+bool RenderView::allowPlugins(WebFrame* frame, bool enabled_per_settings) {
+ if (CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kEnableClickToPlay)) {
+ return WebFrameClient::allowPlugins(frame, enabled_per_settings);
+ }
+ return (enabled_per_settings &&
+ AllowContentType(CONTENT_SETTINGS_TYPE_PLUGINS));
+}
+
+
void RenderView::loadURLExternally(
WebFrame* frame, const WebURLRequest& request,
WebNavigationPolicy policy) {
« no previous file with comments | « chrome/renderer/render_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698