summaryrefslogtreecommitdiffstats
path: root/webkit/glue/webplugin_page_delegate.h
diff options
context:
space:
mode:
authordarin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-02 17:10:59 +0000
committerdarin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-02 17:10:59 +0000
commitf103ab7a3af66f93aa6b674598ee8c977917f5f2 (patch)
tree670587d6caf0d0fc0a864f7b8d6e7b8da8f11f6d /webkit/glue/webplugin_page_delegate.h
parentee2bd0350faae7e862af993b8884d6c9c48559a4 (diff)
downloadchromium_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 'webkit/glue/webplugin_page_delegate.h')
-rw-r--r--webkit/glue/webplugin_page_delegate.h65
1 files changed, 65 insertions, 0 deletions
diff --git a/webkit/glue/webplugin_page_delegate.h b/webkit/glue/webplugin_page_delegate.h
new file mode 100644
index 0000000..56a8cec
--- /dev/null
+++ b/webkit/glue/webplugin_page_delegate.h
@@ -0,0 +1,65 @@
+// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef WEBKIT_GLUE_WEBPLUGIN_PAGE_DELEGATE_
+#define WEBKIT_GLUE_WEBPLUGIN_PAGE_DELEGATE_
+
+#include "base/gfx/native_widget_types.h"
+
+class GURL;
+
+namespace webkit_glue {
+
+class WebPluginDelegate;
+struct WebPluginGeometry;
+
+// Used by the WebPlugin to communicate back to the containing page.
+class WebPluginPageDelegate {
+ public:
+ // This method is called to create a WebPluginDelegate implementation when a
+ // new plugin is instanced. See webkit_glue::CreateWebPluginDelegateHelper
+ // for a default WebPluginDelegate implementation.
+ // TODO(port): clsid is very Win- and ActiveX-specific; refactor to be more
+ // platform-neutral
+ virtual WebPluginDelegate* CreatePluginDelegate(
+ const GURL& url,
+ const std::string& mime_type,
+ const std::string& clsid,
+ std::string* actual_mime_type) = 0;
+
+ // Called when a windowed plugin is created.
+ // Lets the view delegate create anything it is using to wrap the plugin.
+ virtual void CreatedPluginWindow(
+ gfx::PluginWindowHandle handle) = 0;
+
+ // Called when a windowed plugin is closing.
+ // Lets the view delegate shut down anything it is using to wrap the plugin.
+ virtual void WillDestroyPluginWindow(
+ gfx::PluginWindowHandle handle) = 0;
+
+ // Keeps track of the necessary window move for a plugin window that resulted
+ // from a scroll operation. That way, all plugin windows can be moved at the
+ // same time as each other and the page.
+ virtual void DidMovePlugin(
+ const WebPluginGeometry& move) = 0;
+
+ // Notifies the parent view that a load has begun.
+ virtual void DidStartLoadingForPlugin() = 0;
+
+ // Notifies the parent view that all loads are finished.
+ virtual void DidStopLoadingForPlugin() = 0;
+
+ // Asks the browser to show a modal HTML dialog. The dialog is passed the
+ // given arguments as a JSON string, and returns its result as a JSON string
+ // through json_retval.
+ virtual void ShowModalHTMLDialogForPlugin(
+ const GURL& url,
+ const gfx::Size& size,
+ const std::string& json_arguments,
+ std::string* json_retval) = 0;
+};
+
+} // namespace webkit_glue
+
+#endif // WEBKIT_GLUE_WEBPLUGIN_PAGE_DELEGATE_H_