| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef WEBKIT_PLUGINS_PPAPI_PPB_WIDGET_IMPL_H_ | 5 #ifndef WEBKIT_PLUGINS_PPAPI_PPB_WIDGET_IMPL_H_ |
| 6 #define WEBKIT_PLUGINS_PPAPI_PPB_WIDGET_IMPL_H_ | 6 #define WEBKIT_PLUGINS_PPAPI_PPB_WIDGET_IMPL_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/scoped_ptr.h" | 9 #include "base/scoped_ptr.h" |
| 10 #include "ppapi/c/pp_rect.h" | 10 #include "ppapi/c/pp_rect.h" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 virtual PPB_Widget_Impl* AsPPB_Widget_Impl(); | 32 virtual PPB_Widget_Impl* AsPPB_Widget_Impl(); |
| 33 | 33 |
| 34 // PPB_Widget implementation. | 34 // PPB_Widget implementation. |
| 35 virtual bool Paint(const PP_Rect* rect, PPB_ImageData_Impl* image) = 0; | 35 virtual bool Paint(const PP_Rect* rect, PPB_ImageData_Impl* image) = 0; |
| 36 virtual bool HandleEvent(const PP_InputEvent* event) = 0; | 36 virtual bool HandleEvent(const PP_InputEvent* event) = 0; |
| 37 bool GetLocation(PP_Rect* location); | 37 bool GetLocation(PP_Rect* location); |
| 38 void SetLocation(const PP_Rect* location); | 38 void SetLocation(const PP_Rect* location); |
| 39 | 39 |
| 40 // Notifies the plugin instance that the given rect needs to be repainted. | 40 // Notifies the plugin instance that the given rect needs to be repainted. |
| 41 void Invalidate(const PP_Rect* dirty); | 41 void Invalidate(const PP_Rect* dirty); |
| 42 PluginInstance* instance() { return instance_; } | |
| 43 | 42 |
| 44 protected: | 43 protected: |
| 45 virtual void SetLocationInternal(const PP_Rect* location) = 0; | 44 virtual void SetLocationInternal(const PP_Rect* location) = 0; |
| 46 PP_Rect location() const { return location_; } | 45 PP_Rect location() const { return location_; } |
| 47 | 46 |
| 48 private: | 47 private: |
| 49 scoped_refptr<PluginInstance> instance_; | |
| 50 PP_Rect location_; | 48 PP_Rect location_; |
| 51 | 49 |
| 52 DISALLOW_COPY_AND_ASSIGN(PPB_Widget_Impl); | 50 DISALLOW_COPY_AND_ASSIGN(PPB_Widget_Impl); |
| 53 }; | 51 }; |
| 54 | 52 |
| 55 } // namespace ppapi | 53 } // namespace ppapi |
| 56 } // namespace webkit | 54 } // namespace webkit |
| 57 | 55 |
| 58 #endif // WEBKIT_PLUGINS_PPAPI_PPB_WIDGET_IMPL_H_ | 56 #endif // WEBKIT_PLUGINS_PPAPI_PPB_WIDGET_IMPL_H_ |
| OLD | NEW |