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 |