diff options
author | darin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-02 17:10:59 +0000 |
---|---|---|
committer | darin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-02 17:10:59 +0000 |
commit | f103ab7a3af66f93aa6b674598ee8c977917f5f2 (patch) | |
tree | 670587d6caf0d0fc0a864f7b8d6e7b8da8f11f6d /chrome/renderer/webplugin_delegate_proxy.cc | |
parent | ee2bd0350faae7e862af993b8884d6c9c48559a4 (diff) | |
download | chromium_src-f103ab7a3af66f93aa6b674598ee8c977917f5f2.zip chromium_src-f103ab7a3af66f93aa6b674598ee8c977917f5f2.tar.gz chromium_src-f103ab7a3af66f93aa6b674598ee8c977917f5f2.tar.bz2 |
Eliminate remaining WebCore dependencies from webplugin_impl.cc
Introduces WebPluginPageDelegate to hold the methods that only
existed on WebViewDelegate to allow WebPluginImpl to talk to the
RenderView. This enables us to eliminate those methods from
WebViewDelegate, which eliminates the last dependency on gfx/
native_widget_types.h in our WebKit interface!
WebViewDelegate grows a CreatePlugin method that returns a
WebKit::WebPlugin. It loses its CreatePluginDelegate method,
which now lives on WebPluginPageDelegate.
This change makes RenderView use WeakPtr when it hands itself to
each WebPluginDelegateProxy and WebPluginImpl instance. This
makes the memory management simpler.
This change also moves various WebPlugin* interfaces defined in
webkit/glue into the webkit_glue namespace. This was to help
reduce confusion with similarly named types in the WebKit
namespace.
WebKit::WebPluginParams is added to contain the set of parameters
used to construct a plugin.
WebPluginContainer gets a couple more methods to allow us to avoid
WebCore dependencies in WebPluginImpl.
R=jam
BUG=10036
TEST=none
Review URL: http://codereview.chromium.org/181014
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25184 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/webplugin_delegate_proxy.cc')
-rw-r--r-- | chrome/renderer/webplugin_delegate_proxy.cc | 44 |
1 files changed, 33 insertions, 11 deletions
diff --git a/chrome/renderer/webplugin_delegate_proxy.cc b/chrome/renderer/webplugin_delegate_proxy.cc index 2068a50..66cf1c6 100644 --- a/chrome/renderer/webplugin_delegate_proxy.cc +++ b/chrome/renderer/webplugin_delegate_proxy.cc @@ -59,7 +59,7 @@ using WebKit::WebString; // Proxy for WebPluginResourceClient. The object owns itself after creation, // deleting itself after its callback has been called. -class ResourceClientProxy : public WebPluginResourceClient { +class ResourceClientProxy : public webkit_glue::WebPluginResourceClient { public: ResourceClientProxy(PluginChannelHost* channel, int instance_id) : channel_(channel), instance_id_(instance_id), resource_id_(0), @@ -162,13 +162,14 @@ WebPluginDelegateProxy* WebPluginDelegateProxy::Create( const GURL& url, const std::string& mime_type, const std::string& clsid, - RenderView* render_view) { + const base::WeakPtr<RenderView>& render_view) { return new WebPluginDelegateProxy(mime_type, clsid, render_view); } -WebPluginDelegateProxy::WebPluginDelegateProxy(const std::string& mime_type, - const std::string& clsid, - RenderView* render_view) +WebPluginDelegateProxy::WebPluginDelegateProxy( + const std::string& mime_type, + const std::string& clsid, + const base::WeakPtr<RenderView>& render_view) : render_view_(render_view), plugin_(NULL), windowless_(false), @@ -221,13 +222,12 @@ void WebPluginDelegateProxy::PluginDestroyed() { channel_host_ = NULL; } - render_view_->PluginDestroyed(this); MessageLoop::current()->DeleteSoon(FROM_HERE, this); } bool WebPluginDelegateProxy::Initialize(const GURL& url, char** argn, char** argv, int argc, - WebPlugin* plugin, + webkit_glue::WebPlugin* plugin, bool load_manually) { IPC::ChannelHandle channel_handle; FilePath plugin_path; @@ -881,9 +881,10 @@ void WebPluginDelegateProxy::OnShowModalHTMLDialog( const GURL& url, int width, int height, const std::string& json_arguments, std::string* json_retval) { DCHECK(json_retval); - if (render_view_) - render_view_->ShowModalHTMLDialog(url, width, height, json_arguments, - json_retval); + if (render_view_) { + render_view_->ShowModalHTMLDialogForPlugin( + url, gfx::Size(width, height), json_arguments, json_retval); + } } static void EncodeDragData(const WebDragData& data, bool add_data, @@ -1048,7 +1049,8 @@ void WebPluginDelegateProxy::OnHandleURLRequest( params.popups_allowed); } -WebPluginResourceClient* WebPluginDelegateProxy::CreateResourceClient( +webkit_glue::WebPluginResourceClient* +WebPluginDelegateProxy::CreateResourceClient( int resource_id, const GURL& url, bool notify_needed, intptr_t notify_data, intptr_t npstream) { ResourceClientProxy* proxy = new ResourceClientProxy(channel_host_, @@ -1057,6 +1059,26 @@ WebPluginResourceClient* WebPluginDelegateProxy::CreateResourceClient( return proxy; } +bool WebPluginDelegateProxy::IsWindowless() const { + NOTREACHED(); + return false; +} + +gfx::Rect WebPluginDelegateProxy::GetRect() const { + NOTREACHED(); + return gfx::Rect(); +} + +gfx::Rect WebPluginDelegateProxy::GetClipRect() const { + NOTREACHED(); + return gfx::Rect(); +} + +int WebPluginDelegateProxy::GetQuirks() const { + NOTREACHED(); + return 0; +} + void WebPluginDelegateProxy::OnCancelDocumentLoad() { plugin_->CancelDocumentLoad(); } |