Chromium Code Reviews| Index: content/renderer/browser_plugin/browser_plugin.h |
| diff --git a/content/renderer/browser_plugin/browser_plugin_placeholder.h b/content/renderer/browser_plugin/browser_plugin.h |
| similarity index 58% |
| rename from content/renderer/browser_plugin/browser_plugin_placeholder.h |
| rename to content/renderer/browser_plugin/browser_plugin.h |
| index b7c229d6d5bad26d6b2f7be9ce1a4278c4c60648..306eeed9e95a6af0a77052ce014488b3ec024845 100644 |
| --- a/content/renderer/browser_plugin/browser_plugin_placeholder.h |
| +++ b/content/renderer/browser_plugin/browser_plugin.h |
| @@ -2,11 +2,12 @@ |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| -#ifndef CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_PLACEHOLDER_H_ |
| -#define CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_PLACEHOLDER_H_ |
| +#ifndef CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_H_ |
| +#define CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_H_ |
| #pragma once |
| #include "base/process.h" |
| +#include "content/renderer/render_view_impl.h" |
| #include "ipc/ipc_channel_handle.h" |
| #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h" |
| #include "third_party/WebKit/Source/WebKit/chromium/public/WebPluginParams.h" |
| @@ -29,61 +30,65 @@ class WebPlugin; |
| // the UI thread of the browser process. |
| // |
| // To avoid blocking the host RenderView and to avoid introducing the potential |
| -// for deadlock, the BrowserPluginPlaceholder takes place of the guest |
| +// for deadlock, the BrowserPlugin takes place of the guest |
| // RenderView until the guest has established a connection with its host |
| // RenderView. This permits loading the guest to happen asynchronously, while |
| // the host RenderView is permitted to continue to receive and process events. |
| -class BrowserPluginPlaceholder: public webkit::WebViewPlugin::Delegate { |
| +// |
| +// Furthermore, embedder-initiated navigations can point to a new guest |
| +// RenderView on an entirely different process. BrowserPlugin is the consistent |
| +// facade that the embedder talks to regardless of what process it's |
| +// actually communicating with. |
| +class BrowserPlugin { |
| public: |
| - // Creates a new WebViewPlugin with a BrowserPluginPlaceholder as a delegate. |
| - static webkit::WebViewPlugin* Create( |
| - content::RenderView* render_view, |
| + // Creates a new WebViewPlugin with a BrowserPlugin as a delegate. |
| + static WebKit::WebPlugin* Create( |
| + RenderViewImpl* render_view, |
| WebKit::WebFrame* frame, |
| const WebKit::WebPluginParams& params); |
| - static BrowserPluginPlaceholder* FromID(int id); |
| + static BrowserPlugin* FromID(int id); |
| - void RegisterPlaceholder(int id, BrowserPluginPlaceholder* placeholder); |
| - void UnregisterPlaceholder(int id); |
| + static void Register(int id, BrowserPlugin* placeholder); |
|
jam
2012/05/16 02:22:40
these are only called from browser_plugin.cc from
Fady Samuel
2012/05/16 04:43:54
Done.
|
| + static void Unregister(int id); |
| int GetID() { return id_; } |
|
jam
2012/05/16 02:22:40
nit: should be
int id() const { return id_; }
ac
Fady Samuel
2012/05/16 04:43:54
Removed.
|
| - webkit::WebViewPlugin* plugin() { return plugin_; } |
| + webkit::WebViewPlugin* plugin_placeholder() { return placeholder_; } |
|
jam
2012/05/16 02:22:40
nit: placeholder()
Fady Samuel
2012/05/16 04:43:54
Done.
|
| + |
| + webkit::ppapi::WebPluginImpl* plugin() { return plugin_; } |
| const WebKit::WebPluginParams& plugin_params() const; |
|
jam
2012/05/16 02:22:40
if the definition is in the cc file, this can't be
Fady Samuel
2012/05/16 04:43:54
Moved it to here.
|
| - void GuestReady(base::ProcessHandle process_handle, |
| - const IPC::ChannelHandle& channel_handle); |
| + void LoadGuest(int guest_process_id, |
| + const IPC::ChannelHandle& channel_handle); |
| - content::RenderView* render_view() { return render_view_; } |
| + RenderViewImpl* render_view() { return render_view_; } |
| private: |
| - BrowserPluginPlaceholder(content::RenderView* render_view, |
| + BrowserPlugin(RenderViewImpl* render_view, |
| WebKit::WebFrame* frame, |
|
jam
2012/05/16 02:22:40
nit: tabbing
Fady Samuel
2012/05/16 04:43:54
Done.
|
| const WebKit::WebPluginParams& params, |
| const std::string& html_data); |
| - virtual ~BrowserPluginPlaceholder(); |
| + virtual ~BrowserPlugin(); |
| // Grabs the width, height, and source URL of the browser plugin |
| // from the element's attributes. If not found, it uses the defaults |
| // specified here as parameters. |
| void GetPluginParameters(int default_width, int default_height, |
| const std::string& default_src); |
| - // Replace this placeholder with the real browser plugin. |
| - void LoadGuest(WebKit::WebPlugin* new_plugin); |
| - |
| - virtual void BindWebFrame(WebKit::WebFrame* frame) OVERRIDE { } |
| - virtual void WillDestroyPlugin() OVERRIDE; |
| - virtual void ShowContextMenu(const WebKit::WebMouseEvent&) OVERRIDE { } |
| + // Replace the current guest with a new guest. |
| + void Replace(webkit::ppapi::WebPluginImpl* new_plugin); |
| - content::RenderView* render_view_; |
| + RenderViewImpl* render_view_; |
| WebKit::WebPluginParams plugin_params_; |
| - webkit::WebViewPlugin* plugin_; |
| + webkit::WebViewPlugin* placeholder_; |
| + webkit::ppapi::WebPluginImpl* plugin_; |
| int id_; |
| gfx::Size size_; |
| std::string src_; |
| - DISALLOW_COPY_AND_ASSIGN(BrowserPluginPlaceholder); |
| + DISALLOW_COPY_AND_ASSIGN(BrowserPlugin); |
| }; |
| -#endif // CONTNET_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_PLACEHOLDER_H_ |
| +#endif // CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_H_ |