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

Unified Diff: content/shell/shell_content_renderer_client.cc

Issue 11035070: <browser> Disable browser plugin in content_shell by default. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Sync @tott + fix one include order. Created 8 years, 2 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 | « content/shell/shell_content_renderer_client.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/shell/shell_content_renderer_client.cc
diff --git a/content/shell/shell_content_renderer_client.cc b/content/shell/shell_content_renderer_client.cc
index 63c7069c368ba05c44213e8f7282745a63bf0ba6..a17fbe024de3498c9d53924cc42cbadc0009d203 100644
--- a/content/shell/shell_content_renderer_client.cc
+++ b/content/shell/shell_content_renderer_client.cc
@@ -5,9 +5,13 @@
#include "content/shell/shell_content_renderer_client.h"
#include "base/command_line.h"
+#include "content/public/common/content_constants.h"
+#include "content/public/common/content_switches.h"
#include "content/shell/shell_render_process_observer.h"
#include "content/shell/shell_switches.h"
#include "content/shell/webkit_test_runner.h"
+#include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h"
+#include "third_party/WebKit/Source/WebKit/chromium/public/WebPluginParams.h"
#include "v8/include/v8.h"
namespace content {
@@ -29,4 +33,19 @@ void ShellContentRendererClient::RenderViewCreated(RenderView* render_view) {
new WebKitTestRunner(render_view);
}
+bool ShellContentRendererClient::OverrideCreatePlugin(
+ RenderView* render_view,
+ WebKit::WebFrame* frame,
+ const WebKit::WebPluginParams& params,
+ WebKit::WebPlugin** plugin) {
+ std::string mime_type = params.mimeType.utf8();
+ if (mime_type == content::kBrowserPluginMimeType) {
+ // Allow browser plugin in content_shell only if it is forced by flag.
+ // Returning true here disables the plugin.
+ return !CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kEnableBrowserPluginForAllViewTypes);
+ }
+ return false;
+}
+
} // namespace content
« no previous file with comments | « content/shell/shell_content_renderer_client.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698