| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_NPAPI_WEBPLUGIN_H_ | 5 #ifndef CONTENT_CHILD_NPAPI_WEBPLUGIN_H_ |
| 6 #define WEBKIT_PLUGINS_NPAPI_WEBPLUGIN_H_ | 6 #define CONTENT_CHILD_NPAPI_WEBPLUGIN_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 "ui/gfx/native_widget_types.h" | 12 #include "ui/gfx/native_widget_types.h" |
| 13 #include "ui/gfx/rect.h" | 13 #include "ui/gfx/rect.h" |
| 14 #include "ui/gl/gpu_preference.h" | 14 #include "ui/gl/gpu_preference.h" |
| 15 #include "webkit/plugins/webkit_plugins_export.h" | |
| 16 | 15 |
| 17 // TODO(port): this typedef is obviously incorrect on non-Windows | 16 // TODO(port): this typedef is obviously incorrect on non-Windows |
| 18 // platforms, but now a lot of code now accidentally depends on them | 17 // platforms, but now a lot of code now accidentally depends on them |
| 19 // existing. #ifdef out these declarations and fix all the users. | 18 // existing. #ifdef out these declarations and fix all the users. |
| 20 typedef void* HANDLE; | 19 typedef void* HANDLE; |
| 21 | 20 |
| 22 class GURL; | 21 class GURL; |
| 23 struct NPObject; | 22 struct NPObject; |
| 24 | 23 |
| 25 namespace webkit { | 24 namespace content { |
| 26 namespace npapi { | |
| 27 | 25 |
| 28 class WebPluginResourceClient; | 26 class WebPluginResourceClient; |
| 29 #if defined(OS_MACOSX) | 27 #if defined(OS_MACOSX) |
| 30 class WebPluginAcceleratedSurface; | 28 class WebPluginAcceleratedSurface; |
| 31 #endif | 29 #endif |
| 32 | 30 |
| 33 // Describes the new location for a plugin window. | |
| 34 struct WEBKIT_PLUGINS_EXPORT WebPluginGeometry { | |
| 35 WebPluginGeometry(); | |
| 36 ~WebPluginGeometry(); | |
| 37 | |
| 38 bool Equals(const WebPluginGeometry& rhs) const; | |
| 39 | |
| 40 // On Windows, this is the plugin window in the plugin process. | |
| 41 // On X11, this is the XID of the plugin-side GtkPlug containing the | |
| 42 // GtkSocket hosting the actual plugin window. | |
| 43 // | |
| 44 // On Mac OS X, all of the plugin types are currently "windowless" | |
| 45 // (window == 0) except for the special case of the GPU plugin, | |
| 46 // which currently performs rendering on behalf of the Pepper 3D API | |
| 47 // and WebGL. The GPU plugin uses a simple integer for the | |
| 48 // PluginWindowHandle which is used to map to a side data structure | |
| 49 // containing information about the plugin. Soon this plugin will be | |
| 50 // generalized, at which point this mechanism will be rethought or | |
| 51 // removed. | |
| 52 gfx::PluginWindowHandle window; | |
| 53 gfx::Rect window_rect; | |
| 54 // Clip rect (include) and cutouts (excludes), relative to | |
| 55 // window_rect origin. | |
| 56 gfx::Rect clip_rect; | |
| 57 std::vector<gfx::Rect> cutout_rects; | |
| 58 bool rects_valid; | |
| 59 bool visible; | |
| 60 }; | |
| 61 | |
| 62 // The WebKit side of a plugin implementation. It provides wrappers around | 31 // The WebKit side of a plugin implementation. It provides wrappers around |
| 63 // operations that need to interact with the frame and other WebCore objects. | 32 // operations that need to interact with the frame and other WebCore objects. |
| 64 class WebPlugin { | 33 class WebPlugin { |
| 65 public: | 34 public: |
| 66 virtual ~WebPlugin() {} | 35 virtual ~WebPlugin() {} |
| 67 | 36 |
| 68 // Called by the plugin delegate to let the WebPlugin know if the plugin is | 37 // Called by the plugin delegate to let the WebPlugin know if the plugin is |
| 69 // windowed (i.e. handle is not NULL) or windowless (handle is NULL). This | 38 // windowed (i.e. handle is not NULL) or windowless (handle is NULL). This |
| 70 // tells the WebPlugin to send mouse/keyboard events to the plugin delegate, | 39 // tells the WebPlugin to send mouse/keyboard events to the plugin delegate, |
| 71 // as well as the information about the HDC for paint operations. | 40 // as well as the information about the HDC for paint operations. |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 virtual void DidFinishLoading(unsigned long resource_id) = 0; | 154 virtual void DidFinishLoading(unsigned long resource_id) = 0; |
| 186 virtual void DidFail(unsigned long resource_id) = 0; | 155 virtual void DidFail(unsigned long resource_id) = 0; |
| 187 virtual bool IsMultiByteResponseExpected() = 0; | 156 virtual bool IsMultiByteResponseExpected() = 0; |
| 188 virtual int ResourceId() = 0; | 157 virtual int ResourceId() = 0; |
| 189 // Tells this object that it will get responses from multiple resources. | 158 // Tells this object that it will get responses from multiple resources. |
| 190 // This is necessary since the plugin process uses a single instance of | 159 // This is necessary since the plugin process uses a single instance of |
| 191 // PluginStreamUrl object for multiple range requests. | 160 // PluginStreamUrl object for multiple range requests. |
| 192 virtual void AddRangeRequestResourceId(unsigned long resource_id) { } | 161 virtual void AddRangeRequestResourceId(unsigned long resource_id) { } |
| 193 }; | 162 }; |
| 194 | 163 |
| 195 } // namespace npapi | 164 } // namespace content |
| 196 } // namespace webkit | |
| 197 | 165 |
| 198 #endif // WEBKIT_PLUGINS_NPAPI_WEBPLUGIN_H_ | 166 #endif // CONTENT_CHILD_NPAPI_WEBPLUGIN_H_ |
| OLD | NEW |