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

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: 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
Index: content/renderer/render_view_impl.cc
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc
index 3e59c4a9b643091fd8e35480b4daf5dfc1b9df4f..2ecf97294e7fdda70aeafc6bf1b3bef2a21f9c7e 100644
--- a/content/renderer/render_view_impl.cc
+++ b/content/renderer/render_view_impl.cc
@@ -73,6 +73,7 @@
#include "content/renderer/notification_provider.h"
#include "content/renderer/p2p/socket_dispatcher.h"
#include "content/renderer/plugin_channel_host.h"
+#include "content/renderer/plugins/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"
@@ -166,6 +167,7 @@
#include "webkit/plugins/npapi/webplugin_delegate.h"
#include "webkit/plugins/npapi/webplugin_delegate_impl.h"
#include "webkit/plugins/npapi/webplugin_impl.h"
+#include "webkit/plugins/plugin_constants.h"
#include "webkit/plugins/ppapi/ppapi_webplugin_impl.h"
#if defined(OS_WIN)
@@ -2063,6 +2065,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)
jam 2012/03/12 16:30:09 this constant isn't in webkit/plugins/plugin_const
Fady Samuel 2012/03/12 22:11:44 Yes, it is. Added in this cl: const char kBrowserP
+ return BrowserPluginPlaceholder::Create(this, frame, params);
+
WebPlugin* plugin = NULL;
if (content::GetContentClient()->renderer()->OverrideCreatePlugin(
this, frame, params, &plugin)) {

Powered by Google App Engine
This is Rietveld 408576698