| 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_GLUE_PLUGINS_PEPPER_PLUGIN_INSTANCE_H_ | 5 #ifndef WEBKIT_GLUE_PLUGINS_PEPPER_PLUGIN_INSTANCE_H_ |
| 6 #define WEBKIT_GLUE_PLUGINS_PEPPER_PLUGIN_INSTANCE_H_ | 6 #define WEBKIT_GLUE_PLUGINS_PEPPER_PLUGIN_INSTANCE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "base/ref_counted.h" | 12 #include "base/ref_counted.h" |
| 13 #include "base/string16.h" |
| 13 #include "gfx/rect.h" | 14 #include "gfx/rect.h" |
| 14 #include "third_party/ppapi/c/pp_instance.h" | 15 #include "third_party/ppapi/c/pp_instance.h" |
| 15 #include "third_party/ppapi/c/pp_resource.h" | 16 #include "third_party/ppapi/c/pp_resource.h" |
| 16 #include "third_party/WebKit/WebKit/chromium/public/WebCanvas.h" | 17 #include "third_party/WebKit/WebKit/chromium/public/WebCanvas.h" |
| 17 | 18 |
| 18 typedef struct _pp_Var PP_Var; | 19 typedef struct _pp_Var PP_Var; |
| 19 typedef struct _ppb_Instance PPB_Instance; | 20 typedef struct _ppb_Instance PPB_Instance; |
| 20 typedef struct _ppp_Instance PPP_Instance; | 21 typedef struct _ppp_Instance PPP_Instance; |
| 21 | 22 |
| 22 namespace gfx { | 23 namespace gfx { |
| (...skipping 26 matching lines...) Expand all Loading... |
| 49 static PluginInstance* FromPPInstance(PP_Instance instance); | 50 static PluginInstance* FromPPInstance(PP_Instance instance); |
| 50 | 51 |
| 51 PluginDelegate* delegate() const { return delegate_; } | 52 PluginDelegate* delegate() const { return delegate_; } |
| 52 PluginModule* module() const { return module_.get(); } | 53 PluginModule* module() const { return module_.get(); } |
| 53 | 54 |
| 54 WebKit::WebPluginContainer* container() const { return container_; } | 55 WebKit::WebPluginContainer* container() const { return container_; } |
| 55 | 56 |
| 56 const gfx::Rect& position() const { return position_; } | 57 const gfx::Rect& position() const { return position_; } |
| 57 const gfx::Rect& clip() const { return clip_; } | 58 const gfx::Rect& clip() const { return clip_; } |
| 58 | 59 |
| 60 int find_identifier() const { return find_identifier_; } |
| 61 |
| 59 PP_Instance GetPPInstance(); | 62 PP_Instance GetPPInstance(); |
| 60 | 63 |
| 61 // Paints the current backing store to the web page. | 64 // Paints the current backing store to the web page. |
| 62 void Paint(WebKit::WebCanvas* canvas, | 65 void Paint(WebKit::WebCanvas* canvas, |
| 63 const gfx::Rect& plugin_rect, | 66 const gfx::Rect& plugin_rect, |
| 64 const gfx::Rect& paint_rect); | 67 const gfx::Rect& paint_rect); |
| 65 | 68 |
| 66 // Schedules a paint of the page for the given region. The coordinates are | 69 // Schedules a paint of the page for the given region. The coordinates are |
| 67 // relative to the top-left of the plugin. This does nothing if the plugin | 70 // relative to the top-left of the plugin. This does nothing if the plugin |
| 68 // has not yet been positioned. You can supply an empty gfx::Rect() to | 71 // has not yet been positioned. You can supply an empty gfx::Rect() to |
| (...skipping 17 matching lines...) Expand all Loading... |
| 86 WebKit::WebCursorInfo* cursor_info); | 89 WebKit::WebCursorInfo* cursor_info); |
| 87 PP_Var GetInstanceObject(); | 90 PP_Var GetInstanceObject(); |
| 88 void ViewChanged(const gfx::Rect& position, const gfx::Rect& clip); | 91 void ViewChanged(const gfx::Rect& position, const gfx::Rect& clip); |
| 89 | 92 |
| 90 // Notifications that the view has rendered the page and that it has been | 93 // Notifications that the view has rendered the page and that it has been |
| 91 // flushed to the screen. These messages are used to send Flush callbacks to | 94 // flushed to the screen. These messages are used to send Flush callbacks to |
| 92 // the plugin for DeviceContext2D. | 95 // the plugin for DeviceContext2D. |
| 93 void ViewInitiatedPaint(); | 96 void ViewInitiatedPaint(); |
| 94 void ViewFlushedPaint(); | 97 void ViewFlushedPaint(); |
| 95 | 98 |
| 99 string16 GetSelectedText(bool html); |
| 100 void Zoom(float factor, bool text_only); |
| 101 bool SupportsFind(); |
| 102 void StartFind(const string16& search_text, |
| 103 bool case_sensitive, |
| 104 int identifier); |
| 105 void SelectFindResult(bool forward); |
| 106 void StopFind(); |
| 107 |
| 96 private: | 108 private: |
| 97 PluginDelegate* delegate_; | 109 PluginDelegate* delegate_; |
| 98 scoped_refptr<PluginModule> module_; | 110 scoped_refptr<PluginModule> module_; |
| 99 const PPP_Instance* instance_interface_; | 111 const PPP_Instance* instance_interface_; |
| 100 | 112 |
| 101 // NULL until we have been initialized. | 113 // NULL until we have been initialized. |
| 102 WebKit::WebPluginContainer* container_; | 114 WebKit::WebPluginContainer* container_; |
| 103 | 115 |
| 104 // Indicates whether this is a full frame instance, which means it represents | 116 // Indicates whether this is a full frame instance, which means it represents |
| 105 // an entire document rather than an embed tag. | 117 // an entire document rather than an embed tag. |
| 106 bool full_frame_; | 118 bool full_frame_; |
| 107 | 119 |
| 108 // Position in the viewport (which moves as the page is scrolled) of this | 120 // Position in the viewport (which moves as the page is scrolled) of this |
| 109 // plugin. This will be a 0-sized rectangle if the plugin has not yet been | 121 // plugin. This will be a 0-sized rectangle if the plugin has not yet been |
| 110 // laid out. | 122 // laid out. |
| 111 gfx::Rect position_; | 123 gfx::Rect position_; |
| 112 | 124 |
| 113 // Current clip rect. This will be empty if the plugin is not currently | 125 // Current clip rect. This will be empty if the plugin is not currently |
| 114 // visible. This is in the plugin's coordinate system, so fully visible will | 126 // visible. This is in the plugin's coordinate system, so fully visible will |
| 115 // be (0, 0, w, h) regardless of scroll position. | 127 // be (0, 0, w, h) regardless of scroll position. |
| 116 gfx::Rect clip_; | 128 gfx::Rect clip_; |
| 117 | 129 |
| 118 // The current device context for painting in 2D. | 130 // The current device context for painting in 2D. |
| 119 scoped_refptr<DeviceContext2D> device_context_2d_; | 131 scoped_refptr<DeviceContext2D> device_context_2d_; |
| 120 | 132 |
| 133 // The id of the current find operation, or -1 if none is in process. |
| 134 int find_identifier_; |
| 135 |
| 121 DISALLOW_COPY_AND_ASSIGN(PluginInstance); | 136 DISALLOW_COPY_AND_ASSIGN(PluginInstance); |
| 122 }; | 137 }; |
| 123 | 138 |
| 124 } // namespace pepper | 139 } // namespace pepper |
| 125 | 140 |
| 126 #endif // WEBKIT_GLUE_PLUGINS_PEPPER_PLUGIN_INSTANCE_H_ | 141 #endif // WEBKIT_GLUE_PLUGINS_PEPPER_PLUGIN_INSTANCE_H_ |
| OLD | NEW |