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_DELEGATE_H__ | 5 #ifndef WEBKIT_GLUE_WEBPLUGIN_DELEGATE_H__ |
6 #define WEBKIT_GLUE_WEBPLUGIN_DELEGATE_H__ | 6 #define WEBKIT_GLUE_WEBPLUGIN_DELEGATE_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/file_path.h" | 12 #include "base/file_path.h" |
13 #include "base/gfx/native_widget_types.h" | 13 #include "base/gfx/native_widget_types.h" |
14 #include "base/gfx/rect.h" | 14 #include "base/gfx/rect.h" |
| 15 #include "build/build_config.h" |
15 #include "third_party/npapi/bindings/npapi.h" | 16 #include "third_party/npapi/bindings/npapi.h" |
16 | 17 |
| 18 // TODO(port): put in OS_WIN check. |
17 typedef struct HDC__* HDC; | 19 typedef struct HDC__* HDC; |
18 struct NPObject; | 20 struct NPObject; |
19 | 21 |
20 class GURL; | 22 class GURL; |
21 class WebCursor; | 23 class WebCursor; |
22 class WebPlugin; | 24 class WebPlugin; |
23 class WebPluginResourceClient; | 25 class WebPluginResourceClient; |
24 | 26 |
25 // This is the interface that a plugin implementation needs to provide. | 27 // This is the interface that a plugin implementation needs to provide. |
26 class WebPluginDelegate { | 28 class WebPluginDelegate { |
(...skipping 19 matching lines...) Expand all Loading... |
46 virtual void PluginDestroyed() = 0; | 48 virtual void PluginDestroyed() = 0; |
47 | 49 |
48 // Update the geometry of the plugin. This is a request to move the | 50 // Update the geometry of the plugin. This is a request to move the |
49 // plugin, relative to its containing window, to the coords given by | 51 // plugin, relative to its containing window, to the coords given by |
50 // window_rect. Its contents should be clipped to the coords given | 52 // window_rect. Its contents should be clipped to the coords given |
51 // by clip_rect, which are relative to the origin of the plugin | 53 // by clip_rect, which are relative to the origin of the plugin |
52 // window. The clip_rect is in plugin-relative coordinates. | 54 // window. The clip_rect is in plugin-relative coordinates. |
53 virtual void UpdateGeometry(const gfx::Rect& window_rect, | 55 virtual void UpdateGeometry(const gfx::Rect& window_rect, |
54 const gfx::Rect& clip_rect) = 0; | 56 const gfx::Rect& clip_rect) = 0; |
55 | 57 |
| 58 #if defined(OS_WIN) |
56 // Tells the plugin to paint the damaged rect. The HDC is only used for | 59 // Tells the plugin to paint the damaged rect. The HDC is only used for |
57 // windowless plugins. | 60 // windowless plugins. |
58 virtual void Paint(HDC hdc, const gfx::Rect& rect) = 0; | 61 virtual void Paint(HDC hdc, const gfx::Rect& rect) = 0; |
59 | 62 |
60 // Tells the plugin to print itself. | 63 // Tells the plugin to print itself. |
61 virtual void Print(HDC hdc) = 0; | 64 virtual void Print(HDC hdc) = 0; |
| 65 #else |
| 66 // TODO(port): these are not intended to be implementable for now, |
| 67 // and will have the prototypes fixed once they are implemented. |
| 68 |
| 69 // Tells the plugin to paint the damaged rect. The HDC is only used for |
| 70 // windowless plugins. |
| 71 virtual void Paint(void* dc, const gfx::Rect& rect) = 0; |
| 72 |
| 73 // Tells the plugin to print itself. |
| 74 virtual void Print(void* dc) = 0; |
| 75 #endif |
62 | 76 |
63 // Informs the plugin that it now has focus. | 77 // Informs the plugin that it now has focus. |
64 virtual void SetFocus() = 0; | 78 virtual void SetFocus() = 0; |
65 | 79 |
66 // For windowless plugins, gives them a user event like mouse/keyboard. | 80 // For windowless plugins, gives them a user event like mouse/keyboard. |
67 // Returns whether the event was handled. | 81 // Returns whether the event was handled. |
68 virtual bool HandleEvent(NPEvent* event, WebCursor* cursor) = 0; | 82 virtual bool HandleEvent(NPEvent* event, WebCursor* cursor) = 0; |
69 | 83 |
70 // Gets the NPObject associated with the plugin for scripting. | 84 // Gets the NPObject associated with the plugin for scripting. |
71 virtual NPObject* GetPluginScriptableObject() = 0; | 85 virtual NPObject* GetPluginScriptableObject() = 0; |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 | 130 |
117 // Notifies the delegate about a Get/Post URL request getting routed. | 131 // Notifies the delegate about a Get/Post URL request getting routed. |
118 virtual void URLRequestRouted(const std::string&url, bool notify_needed, | 132 virtual void URLRequestRouted(const std::string&url, bool notify_needed, |
119 void* notify_data) = 0; | 133 void* notify_data) = 0; |
120 private: | 134 private: |
121 DISALLOW_EVIL_CONSTRUCTORS(WebPluginDelegate); | 135 DISALLOW_EVIL_CONSTRUCTORS(WebPluginDelegate); |
122 }; | 136 }; |
123 | 137 |
124 #endif // #ifndef WEBKIT_GLUE_WEBPLUGIN_DELEGATE_H__ | 138 #endif // #ifndef WEBKIT_GLUE_WEBPLUGIN_DELEGATE_H__ |
125 | 139 |
OLD | NEW |