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..e824a2d6527c0cd5c2e3f3db2e2e48cfd5a1f292 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/WebPluginParams.h" |
+#include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" |
#include "v8/include/v8.h" |
namespace content { |
@@ -29,4 +33,18 @@ 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. |
Charlie Reis
2012/10/08 16:47:20
The behavior of this API isn't immediately obvious
lazyboy
2012/10/08 19:23:57
Done.
|
+ return !CommandLine::ForCurrentProcess()->HasSwitch( |
+ switches::kEnableBrowserPluginForAllViewTypes); |
+ } |
+ return false; |
+} |
+ |
} // namespace content |