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

Unified Diff: content/renderer/render_view_impl.cc

Issue 9668031: Implement BrowserPluginPlaceholder. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Possibly fixed merge issue Created 8 years, 9 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/renderer/browser_plugin/browser_plugin_placeholder.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_view_impl.cc
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc
index b1cd5f16ef0962d3e23ef779b1e3c8ed91cc3429..0574433abd9ac07ca80effdc6661a63d6eebc261 100644
--- a/content/renderer/render_view_impl.cc
+++ b/content/renderer/render_view_impl.cc
@@ -73,6 +73,8 @@
#include "content/renderer/notification_provider.h"
#include "content/renderer/p2p/socket_dispatcher.h"
#include "content/renderer/plugin_channel_host.h"
+#include "content/renderer/browser_plugin/browser_plugin_constants.h"
+#include "content/renderer/browser_plugin/browser_plugin_placeholder.h"
#include "content/renderer/render_process.h"
#include "content/renderer/render_thread_impl.h"
#include "content/renderer/render_widget_fullscreen_pepper.h"
@@ -2066,6 +2068,15 @@ bool RenderViewImpl::isPointerLocked() {
WebPlugin* RenderViewImpl::createPlugin(WebFrame* frame,
const WebPluginParams& params) {
+ // The browser plugin is a special kind of pepper plugin
+ // that loads asynchronously. We first create a placeholder here.
+ // When a guest is ready to be displayed, we swap out the placeholder
+ // with the guest.
+ const CommandLine& command_line = *CommandLine::ForCurrentProcess();
+ if (command_line.HasSwitch(switches::kEnableBrowserPlugin) &&
+ UTF16ToASCII(params.mimeType) == kBrowserPluginMimeType)
+ return BrowserPluginPlaceholder::Create(this, frame, params);
+
WebPlugin* plugin = NULL;
if (content::GetContentClient()->renderer()->OverrideCreatePlugin(
this, frame, params, &plugin)) {
« no previous file with comments | « content/renderer/browser_plugin/browser_plugin_placeholder.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698