summaryrefslogtreecommitdiffstats
path: root/webkit/plugins/ppapi/ppapi_plugin_instance.h
diff options
context:
space:
mode:
Diffstat (limited to 'webkit/plugins/ppapi/ppapi_plugin_instance.h')
-rw-r--r--webkit/plugins/ppapi/ppapi_plugin_instance.h47
1 files changed, 23 insertions, 24 deletions
diff --git a/webkit/plugins/ppapi/ppapi_plugin_instance.h b/webkit/plugins/ppapi/ppapi_plugin_instance.h
index 2dfc21d..bb43a9d 100644
--- a/webkit/plugins/ppapi/ppapi_plugin_instance.h
+++ b/webkit/plugins/ppapi/ppapi_plugin_instance.h
@@ -24,6 +24,7 @@
#include "ppapi/c/ppb_input_event.h"
#include "ppapi/shared_impl/function_group_base.h"
#include "ppapi/shared_impl/ppb_instance_shared.h"
+#include "ppapi/shared_impl/ppb_view_shared.h"
#include "ppapi/thunk/ppb_instance_api.h"
#include "third_party/skia/include/core/SkRefCnt.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebCanvas.h"
@@ -85,10 +86,13 @@ class WEBKIT_PLUGINS_EXPORT PluginInstance :
public ::ppapi::PPB_Instance_Shared {
public:
// Create and return a PluginInstance object which supports the
- // PPP_Instance_1_0 interface.
+ // given version.
static PluginInstance* Create1_0(PluginDelegate* delegate,
PluginModule* module,
const void* ppp_instance_if_1_0);
+ static PluginInstance* Create1_1(PluginDelegate* delegate,
+ PluginModule* module,
+ const void* ppp_instance_if_1_1);
// Delete should be called by the WebPlugin before this destructor.
virtual ~PluginInstance();
@@ -99,9 +103,6 @@ class WEBKIT_PLUGINS_EXPORT PluginInstance :
WebKit::WebPluginContainer* container() const { return container_; }
- const gfx::Rect& position() const { return position_; }
- const gfx::Rect& clip() const { return clip_; }
-
void set_always_on_top(bool on_top) { always_on_top_ = on_top; }
// Returns the PP_Instance uniquely identifying this instance. Guaranteed
@@ -144,6 +145,7 @@ class WEBKIT_PLUGINS_EXPORT PluginInstance :
// PPB_Instance and PPB_Instance_Private implementation.
const GURL& plugin_url() const { return plugin_url_; }
bool full_frame() const { return full_frame_; }
+ const ::ppapi::ViewData& view_data() const { return view_data_; }
// If |type| is not PP_CURSORTYPE_CUSTOM, |custom_image| and |hot_spot| are
// ignored.
bool SetCursor(PP_CursorType_Dev type,
@@ -306,6 +308,7 @@ class WEBKIT_PLUGINS_EXPORT PluginInstance :
virtual PP_Bool BindGraphics(PP_Instance instance,
PP_Resource device) OVERRIDE;
virtual PP_Bool IsFullFrame(PP_Instance instance) OVERRIDE;
+ virtual const ::ppapi::ViewData* GetViewData(PP_Instance instance) OVERRIDE;
virtual PP_Var GetWindowObject(PP_Instance instance) OVERRIDE;
virtual PP_Var GetOwnerElementObject(PP_Instance instance) OVERRIDE;
virtual PP_Var ExecuteScript(PP_Instance instance,
@@ -329,7 +332,6 @@ class WEBKIT_PLUGINS_EXPORT PluginInstance :
PP_Bool fullscreen) OVERRIDE;
virtual PP_Bool FlashGetScreenSize(PP_Instance instance,
PP_Size* size) OVERRIDE;
- virtual PP_Bool IsFullscreen(PP_Instance instance) OVERRIDE;
virtual PP_Bool SetFullscreen(PP_Instance instance,
PP_Bool fullscreen) OVERRIDE;
virtual PP_Bool GetScreenSize(PP_Instance instance, PP_Size* size)
@@ -384,6 +386,10 @@ class WEBKIT_PLUGINS_EXPORT PluginInstance :
// (see has_webkit_focus_ below).
bool PluginHasFocus() const;
+ void ScheduleAsyncDidChangeView(const ::ppapi::ViewData& previous_view);
+ void SendAsyncDidChangeView(const ::ppapi::ViewData& previous_view);
+ void SendDidChangeView(const ::ppapi::ViewData& previous_view);
+
// Reports the current plugin geometry to the plugin by calling
// DidChangeView.
void ReportGeometry();
@@ -444,9 +450,6 @@ class WEBKIT_PLUGINS_EXPORT PluginInstance :
// compositing path.
bool IsViewAccelerated();
- // Remember view parameters that were sent to the plugin.
- void SetSentDidChangeView(const gfx::Rect& position, const gfx::Rect& clip);
-
// Track, set and reset size attributes to control the size of the plugin
// in and out of fullscreen mode.
void KeepSizeAttributesBeforeFullscreen();
@@ -469,20 +472,19 @@ class WEBKIT_PLUGINS_EXPORT PluginInstance :
// an entire document rather than an embed tag.
bool full_frame_;
+ // Stores the current state of the plugin view.
+ ::ppapi::ViewData view_data_;
+
// Indicates if we've ever sent a didChangeView to the plugin. This ensure we
// always send an initial notification, even if the position and clip are the
// same as the default values.
- bool sent_did_change_view_;
-
- // Position in the viewport (which moves as the page is scrolled) of this
- // plugin. This will be a 0-sized rectangle if the plugin has not yet been
- // laid out.
- gfx::Rect position_;
+ bool sent_initial_did_change_view_;
- // Current clip rect. This will be empty if the plugin is not currently
- // visible. This is in the plugin's coordinate system, so fully visible will
- // be (0, 0, w, h) regardless of scroll position.
- gfx::Rect clip_;
+ // Set to true when we've scheduled an asynchronous DidChangeView update for
+ // the purposes of consolidating updates. When this is set, code should
+ // update the view_data_ but not send updates. It will be cleared once the
+ // asynchronous update has been sent out.
+ bool suppress_did_change_view_;
// The current device context for painting in 2D or 3D.
scoped_refptr< ::ppapi::Resource> bound_graphics_;
@@ -556,8 +558,9 @@ class WEBKIT_PLUGINS_EXPORT PluginInstance :
// flash_fullscreen_ is false (see above).
FullscreenContainer* fullscreen_container_;
- // True if we are in fullscreen mode. False if we are in normal mode or
- // in transition to fullscreen.
+ // True if we are in "flash" fullscreen mode. False if we are in normal mode
+ // or in transition to fullscreen. Normal fullscreen mode is indicated in
+ // the ViewData.
bool flash_fullscreen_;
// Implementation of PPB_Fullscreen.
@@ -568,10 +571,6 @@ class WEBKIT_PLUGINS_EXPORT PluginInstance :
// fullscreen.
bool desired_fullscreen_state_;
- // True if we are in fullscreen mode. False if we are in normal mode.
- // It reflects the previous state when in transition.
- bool fullscreen_;
-
// WebKit does not resize the plugin when going into fullscreen mode, so we do
// this here by modifying the various plugin attributes and then restoring
// them on exit.