summaryrefslogtreecommitdiffstats
path: root/webkit/glue/plugins/pepper_webplugin_impl.h
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-12 05:29:03 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-12 05:29:03 +0000
commitbd1b93d983c6cbf8e32458bd36a3aadf7490a770 (patch)
tree4670a311dfa2faf487a9b1810ca2eda6df64e8e6 /webkit/glue/plugins/pepper_webplugin_impl.h
parentbeaafbaf7a599c92912702bc2b5b3e770849a74a (diff)
downloadchromium_src-bd1b93d983c6cbf8e32458bd36a3aadf7490a770.zip
chromium_src-bd1b93d983c6cbf8e32458bd36a3aadf7490a770.tar.gz
chromium_src-bd1b93d983c6cbf8e32458bd36a3aadf7490a770.tar.bz2
Implement a version of WebPlugin for Pepper to bypass the current NPAPI
WebPluginImpl. We don't need most of that NPAPI cruft and can remove this extra layer of abstraction to keep our code simpler. TEST=none BUG=none Review URL: http://codereview.chromium.org/2001014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@47010 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/plugins/pepper_webplugin_impl.h')
-rw-r--r--webkit/glue/plugins/pepper_webplugin_impl.h75
1 files changed, 75 insertions, 0 deletions
diff --git a/webkit/glue/plugins/pepper_webplugin_impl.h b/webkit/glue/plugins/pepper_webplugin_impl.h
new file mode 100644
index 0000000..5213cbb
--- /dev/null
+++ b/webkit/glue/plugins/pepper_webplugin_impl.h
@@ -0,0 +1,75 @@
+// Copyright (c) 2010 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_PLUGINS_PEPPER_WEBPLUGIN_IMPL_H_
+#define WEBKIT_GLUE_PLUGINS_PEPPER_WEBPLUGIN_IMPL_H_
+
+#include <vector>
+
+#include "base/weak_ptr.h"
+#include "gfx/rect.h"
+#include "third_party/WebKit/WebKit/chromium/public/WebPlugin.h"
+
+namespace WebKit {
+class WebFrame;
+struct WebPluginParams;
+}
+
+namespace pepper {
+
+class PluginDelegate;
+class PluginInstance;
+
+class WebPluginImpl : public WebKit::WebPlugin {
+ public:
+ WebPluginImpl(WebKit::WebFrame* frame,
+ const WebKit::WebPluginParams& params,
+ const base::WeakPtr<PluginDelegate>& plugin_delegate);
+ ~WebPluginImpl();
+
+ // WebKit::WebPlugin implementation.
+ virtual bool initialize(WebKit::WebPluginContainer* container);
+ virtual void destroy();
+ virtual NPObject* scriptableObject();
+ virtual void paint(WebKit::WebCanvas* canvas, const WebKit::WebRect& rect);
+ virtual void updateGeometry(
+ const WebKit::WebRect& frame_rect,
+ const WebKit::WebRect& clip_rect,
+ const WebKit::WebVector<WebKit::WebRect>& cut_outs_rects,
+ bool is_visible);
+ virtual void updateFocus(bool focused);
+ virtual void updateVisibility(bool visible);
+ virtual bool acceptsInputEvents();
+ virtual bool handleInputEvent(const WebKit::WebInputEvent& event,
+ WebKit::WebCursorInfo& cursor_info);
+ virtual void didReceiveResponse(const WebKit::WebURLResponse& response);
+ virtual void didReceiveData(const char* data, int data_length);
+ virtual void didFinishLoading();
+ virtual void didFailLoading(const WebKit::WebURLError&);
+ virtual void didFinishLoadingFrameRequest(const WebKit::WebURL& url,
+ void* notify_data);
+ virtual void didFailLoadingFrameRequest(const WebKit::WebURL& url,
+ void* notify_data,
+ const WebKit::WebURLError& error);
+
+ public:
+ base::WeakPtr<PluginDelegate> plugin_delegate_;
+
+ scoped_refptr<PluginInstance> instance_;
+
+ // Can be NULL.
+ WebKit::WebPluginContainer* container_;
+
+ // Holds the list of argument names and values passed to the plugin.
+ std::vector<std::string> arg_names_;
+ std::vector<std::string> arg_values_;
+
+ gfx::Rect plugin_rect_;
+
+ DISALLOW_COPY_AND_ASSIGN(WebPluginImpl);
+};
+
+} // namespace pepper
+
+#endif // WEBKIT_GLUE_PLUGINS_PEPPER_WEBPLUGIN_IMPL_H_