Index: webkit/plugins/ppapi/ppb_widget_impl.h |
=================================================================== |
--- webkit/plugins/ppapi/ppb_widget_impl.h (revision 89672) |
+++ webkit/plugins/ppapi/ppb_widget_impl.h (working copy) |
@@ -8,40 +8,45 @@ |
#include "base/basictypes.h" |
#include "base/memory/scoped_ptr.h" |
#include "ppapi/c/pp_rect.h" |
+#include "ppapi/thunk/ppb_widget_api.h" |
#include "webkit/plugins/ppapi/resource.h" |
struct PPB_Widget_Dev; |
struct PP_InputEvent; |
+namespace gfx { |
+class Rect; |
+} |
+ |
namespace webkit { |
namespace ppapi { |
-class PPB_ImageData_Impla; |
+class PPB_ImageData_Impl; |
class PluginInstance; |
-class PPB_Widget_Impl : public Resource { |
+class PPB_Widget_Impl : public Resource, |
+ public ::ppapi::thunk::PPB_Widget_API { |
public: |
explicit PPB_Widget_Impl(PluginInstance* instance); |
virtual ~PPB_Widget_Impl(); |
- // Returns a pointer to the interface implementing PPB_Widget that is |
- // exposed to the plugin. |
- static const PPB_Widget_Dev* GetInterface(); |
+ // ResourceObjectBase overrides. |
+ virtual ::ppapi::thunk::PPB_Widget_API* AsPPB_Widget_API() OVERRIDE; |
- // Resource overrides. |
- virtual PPB_Widget_Impl* AsPPB_Widget_Impl(); |
+ // PPB_WidgetAPI implementation. |
+ virtual PP_Bool Paint(const PP_Rect* rect, PP_Resource ) OVERRIDE; |
+ virtual PP_Bool HandleEvent(const PP_InputEvent* event) = 0; |
+ virtual PP_Bool GetLocation(PP_Rect* location) OVERRIDE; |
+ virtual void SetLocation(const PP_Rect* location) OVERRIDE; |
- // PPB_Widget implementation. |
- virtual bool Paint(const PP_Rect* rect, PPB_ImageData_Impl* image) = 0; |
- virtual bool HandleEvent(const PP_InputEvent* event) = 0; |
- bool GetLocation(PP_Rect* location); |
- void SetLocation(const PP_Rect* location); |
- |
// Notifies the plugin instance that the given rect needs to be repainted. |
void Invalidate(const PP_Rect* dirty); |
protected: |
+ virtual PP_Bool PaintInternal(const gfx::Rect& rect, |
+ PPB_ImageData_Impl* image) = 0; |
virtual void SetLocationInternal(const PP_Rect* location) = 0; |
+ |
PP_Rect location() const { return location_; } |
private: |