OLD | NEW |
1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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 |
(...skipping 14 matching lines...) Expand all Loading... |
25 } | 25 } |
26 | 26 |
27 namespace webkit_glue { | 27 namespace webkit_glue { |
28 | 28 |
29 class WebPluginDelegate; | 29 class WebPluginDelegate; |
30 class WebPluginParentView; | 30 class WebPluginParentView; |
31 class WebPluginResourceClient; | 31 class WebPluginResourceClient; |
32 | 32 |
33 // Describes the new location for a plugin window. | 33 // Describes the new location for a plugin window. |
34 struct WebPluginGeometry { | 34 struct WebPluginGeometry { |
| 35 WebPluginGeometry(); |
| 36 |
| 37 bool Equals(const WebPluginGeometry& rhs) const; |
| 38 |
35 // On Windows, this is the plugin window in the plugin process. | 39 // On Windows, this is the plugin window in the plugin process. |
36 // On X11, this is the XID of the plugin-side GtkPlug containing the | 40 // On X11, this is the XID of the plugin-side GtkPlug containing the |
37 // GtkSocket hosting the actual plugin window. | 41 // GtkSocket hosting the actual plugin window. |
38 gfx::PluginWindowHandle window; | 42 gfx::PluginWindowHandle window; |
39 gfx::Rect window_rect; | 43 gfx::Rect window_rect; |
40 // Clip rect (include) and cutouts (excludes), relative to | 44 // Clip rect (include) and cutouts (excludes), relative to |
41 // window_rect origin. | 45 // window_rect origin. |
42 gfx::Rect clip_rect; | 46 gfx::Rect clip_rect; |
43 std::vector<gfx::Rect> cutout_rects; | 47 std::vector<gfx::Rect> cutout_rects; |
44 bool rects_valid; | 48 bool rects_valid; |
45 bool visible; | 49 bool visible; |
46 }; | 50 }; |
47 | 51 |
48 // The WebKit side of a plugin implementation. It provides wrappers around | 52 // The WebKit side of a plugin implementation. It provides wrappers around |
49 // operations that need to interact with the frame and other WebCore objects. | 53 // operations that need to interact with the frame and other WebCore objects. |
50 class WebPlugin { | 54 class WebPlugin { |
51 public: | 55 public: |
52 virtual ~WebPlugin() {} | 56 virtual ~WebPlugin() {} |
53 | 57 |
54 // Called by the plugin delegate to let the WebPlugin know if the plugin is | 58 // Called by the plugin delegate to let the WebPlugin know if the plugin is |
55 // windowed (i.e. handle is not NULL) or windowless (handle is NULL). This | 59 // windowed (i.e. handle is not NULL) or windowless (handle is NULL). This |
56 // tells the WebPlugin to send mouse/keyboard events to the plugin delegate, | 60 // tells the WebPlugin to send mouse/keyboard events to the plugin delegate, |
57 // as well as the information about the HDC for paint operations. | 61 // as well as the information about the HDC for paint operations. |
58 virtual void SetWindow(gfx::PluginWindowHandle window) = 0; | 62 virtual void SetWindow(gfx::PluginWindowHandle window) = 0; |
59 | 63 |
| 64 // Whether input events should be sent to the delegate. |
| 65 virtual void SetAcceptsInputEvents(bool accepts) = 0; |
| 66 |
60 // Called by the plugin delegate to let it know that the window is being | 67 // Called by the plugin delegate to let it know that the window is being |
61 // destroyed. | 68 // destroyed. |
62 virtual void WillDestroyWindow(gfx::PluginWindowHandle window) = 0; | 69 virtual void WillDestroyWindow(gfx::PluginWindowHandle window) = 0; |
63 #if defined(OS_WIN) | 70 #if defined(OS_WIN) |
64 // The pump_messages_event is a event handle which is valid only for | 71 // The pump_messages_event is a event handle which is valid only for |
65 // windowless plugins and is used in NPP_HandleEvent calls to pump messages | 72 // windowless plugins and is used in NPP_HandleEvent calls to pump messages |
66 // if the plugin enters a modal loop. | 73 // if the plugin enters a modal loop. |
67 // Cancels a pending request. | 74 // Cancels a pending request. |
68 virtual void SetWindowlessPumpEvent(HANDLE pump_messages_event) = 0; | 75 virtual void SetWindowlessPumpEvent(HANDLE pump_messages_event) = 0; |
69 #endif | 76 #endif |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 virtual void DidReceiveData(const char* buffer, int length, | 156 virtual void DidReceiveData(const char* buffer, int length, |
150 int data_offset) = 0; | 157 int data_offset) = 0; |
151 virtual void DidFinishLoading() = 0; | 158 virtual void DidFinishLoading() = 0; |
152 virtual void DidFail() = 0; | 159 virtual void DidFail() = 0; |
153 virtual bool IsMultiByteResponseExpected() = 0; | 160 virtual bool IsMultiByteResponseExpected() = 0; |
154 }; | 161 }; |
155 | 162 |
156 } // namespace webkit_glue | 163 } // namespace webkit_glue |
157 | 164 |
158 #endif // #ifndef WEBKIT_GLUE_WEBPLUGIN_H_ | 165 #endif // #ifndef WEBKIT_GLUE_WEBPLUGIN_H_ |
OLD | NEW |