OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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_WEBPLUGIN_H__ | 5 #ifndef WEBKIT_GLUE_WEBPLUGIN_H__ |
6 #define WEBKIT_GLUE_WEBPLUGIN_H__ | 6 #define WEBKIT_GLUE_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 "base/gfx/rect.h" | 12 #include "base/gfx/rect.h" |
13 #include "base/gfx/native_widget_types.h" | 13 #include "base/gfx/native_widget_types.h" |
14 | 14 |
15 // TODO(port): this typedef is obviously incorrect on non-Windows | 15 // TODO(port): this typedef is obviously incorrect on non-Windows |
16 // platforms, but now a lot of code now accidentally depends on them | 16 // platforms, but now a lot of code now accidentally depends on them |
17 // existing. #ifdef out these declarations and fix all the users. | 17 // existing. #ifdef out these declarations and fix all the users. |
18 typedef void* HANDLE; | 18 typedef void* HANDLE; |
19 | 19 |
20 class GURL; | 20 class GURL; |
21 class WebFrame; | 21 class WebFrame; |
22 class WebPluginResourceClient; | 22 class WebPluginResourceClient; |
23 | 23 |
24 struct NPObject; | 24 struct NPObject; |
25 | 25 |
26 // Describes the new location for a plugin window. | 26 // Describes the new location for a plugin window. |
27 struct WebPluginGeometry { | 27 struct WebPluginGeometry { |
28 gfx::NativeView window; | 28 // On Windows, this is the plugin window in the plugin process. |
| 29 // On X11, this is the browser process's hosting window (the GtkSocket). |
| 30 gfx::PluginWindowHandle window; |
29 gfx::Rect window_rect; | 31 gfx::Rect window_rect; |
30 // Clip rect (include) and cutouts (excludes), relative to | 32 // Clip rect (include) and cutouts (excludes), relative to |
31 // window_rect origin. | 33 // window_rect origin. |
32 gfx::Rect clip_rect; | 34 gfx::Rect clip_rect; |
33 std::vector<gfx::Rect> cutout_rects; | 35 std::vector<gfx::Rect> cutout_rects; |
34 bool rects_valid; | 36 bool rects_valid; |
35 bool visible; | 37 bool visible; |
36 }; | 38 }; |
37 | 39 |
38 | 40 |
39 enum RoutingStatus { | 41 enum RoutingStatus { |
40 ROUTED, | 42 ROUTED, |
41 NOT_ROUTED, | 43 NOT_ROUTED, |
42 INVALID_URL, | 44 INVALID_URL, |
43 GENERAL_FAILURE | 45 GENERAL_FAILURE |
44 }; | 46 }; |
45 | 47 |
46 // The WebKit side of a plugin implementation. It provides wrappers around | 48 // The WebKit side of a plugin implementation. It provides wrappers around |
47 // operations that need to interact with the frame and other WebCore objects. | 49 // operations that need to interact with the frame and other WebCore objects. |
48 class WebPlugin { | 50 class WebPlugin { |
49 public: | 51 public: |
50 WebPlugin() { } | 52 WebPlugin() { } |
51 virtual ~WebPlugin() { } | 53 virtual ~WebPlugin() { } |
52 | 54 |
53 // Called by the plugin delegate to let the WebPlugin know if the plugin is | 55 // Called by the plugin delegate to let the WebPlugin know if the plugin is |
54 // windowed (i.e. handle is not NULL) or windowless (handle is NULL). This | 56 // windowed (i.e. handle is not NULL) or windowless (handle is NULL). This |
55 // tells the WebPlugin to send mouse/keyboard events to the plugin delegate, | 57 // tells the WebPlugin to send mouse/keyboard events to the plugin delegate, |
56 // as well as the information about the HDC for paint operations. | 58 // as well as the information about the HDC for paint operations. |
57 virtual void SetWindow(gfx::NativeView window) = 0; | 59 virtual void SetWindow(gfx::PluginWindowHandle window) = 0; |
58 | 60 |
59 // Called by the plugin delegate to let it know that the window is being | 61 // Called by the plugin delegate to let it know that the window is being |
60 // destroyed. | 62 // destroyed. |
61 virtual void WillDestroyWindow(gfx::NativeView window) = 0; | 63 virtual void WillDestroyWindow(gfx::PluginWindowHandle window) = 0; |
62 #if defined(OS_WIN) | 64 #if defined(OS_WIN) |
63 // The pump_messages_event is a event handle which is valid only for | 65 // The pump_messages_event is a event handle which is valid only for |
64 // windowless plugins and is used in NPP_HandleEvent calls to pump messages | 66 // windowless plugins and is used in NPP_HandleEvent calls to pump messages |
65 // if the plugin enters a modal loop. | 67 // if the plugin enters a modal loop. |
66 // Cancels a pending request. | 68 // Cancels a pending request. |
67 virtual void SetWindowlessPumpEvent(HANDLE pump_messages_event) = 0; | 69 virtual void SetWindowlessPumpEvent(HANDLE pump_messages_event) = 0; |
68 #endif | 70 #endif |
69 virtual void CancelResource(int id) = 0; | 71 virtual void CancelResource(int id) = 0; |
70 virtual void Invalidate() = 0; | 72 virtual void Invalidate() = 0; |
71 virtual void InvalidateRect(const gfx::Rect& rect) = 0; | 73 virtual void InvalidateRect(const gfx::Rect& rect) = 0; |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 bool* cancel) = 0; | 143 bool* cancel) = 0; |
142 virtual void DidReceiveData(const char* buffer, int length, | 144 virtual void DidReceiveData(const char* buffer, int length, |
143 int data_offset) = 0; | 145 int data_offset) = 0; |
144 virtual void DidFinishLoading() = 0; | 146 virtual void DidFinishLoading() = 0; |
145 virtual void DidFail() = 0; | 147 virtual void DidFail() = 0; |
146 virtual bool IsMultiByteResponseExpected() = 0; | 148 virtual bool IsMultiByteResponseExpected() = 0; |
147 }; | 149 }; |
148 | 150 |
149 | 151 |
150 #endif // #ifndef WEBKIT_GLUE_WEBPLUGIN_H__ | 152 #endif // #ifndef WEBKIT_GLUE_WEBPLUGIN_H__ |
OLD | NEW |