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> | |
9 #include <vector> | 8 #include <vector> |
10 | 9 |
11 #include "base/basictypes.h" | |
12 #include "base/file_path.h" | |
13 #include "base/gfx/native_widget_types.h" | 10 #include "base/gfx/native_widget_types.h" |
14 #include "base/gfx/rect.h" | |
15 #include "build/build_config.h" | |
16 #include "third_party/npapi/bindings/npapi.h" | 11 #include "third_party/npapi/bindings/npapi.h" |
17 | 12 |
18 // TODO(port): put in OS_WIN check. | 13 // TODO(port): put in OS_WIN check. |
19 typedef struct HDC__* HDC; | 14 typedef struct HDC__* HDC; |
20 struct NPObject; | 15 struct NPObject; |
21 | 16 |
| 17 class FilePath; |
22 class GURL; | 18 class GURL; |
23 class WebCursor; | 19 class WebCursor; |
24 class WebPlugin; | 20 class WebPlugin; |
25 class WebPluginResourceClient; | 21 class WebPluginResourceClient; |
26 | 22 |
| 23 namespace gfx { |
| 24 class Rect; |
| 25 } |
| 26 |
27 // This is the interface that a plugin implementation needs to provide. | 27 // This is the interface that a plugin implementation needs to provide. |
28 class WebPluginDelegate { | 28 class WebPluginDelegate { |
29 public: | 29 public: |
30 #if defined(OS_WIN) | 30 #if defined(OS_WIN) |
31 enum PluginQuirks { | 31 enum PluginQuirks { |
32 PLUGIN_QUIRK_SETWINDOW_TWICE = 1, | 32 PLUGIN_QUIRK_SETWINDOW_TWICE = 1, |
33 PLUGIN_QUIRK_THROTTLE_WM_USER_PLUS_ONE = 2, | 33 PLUGIN_QUIRK_THROTTLE_WM_USER_PLUS_ONE = 2, |
34 PLUGIN_QUIRK_DONT_CALL_WND_PROC_RECURSIVELY = 4, | 34 PLUGIN_QUIRK_DONT_CALL_WND_PROC_RECURSIVELY = 4, |
35 PLUGIN_QUIRK_DONT_SET_NULL_WINDOW_HANDLE_ON_DESTROY = 8, | 35 PLUGIN_QUIRK_DONT_SET_NULL_WINDOW_HANDLE_ON_DESTROY = 8, |
36 PLUGIN_QUIRK_DONT_ALLOW_MULTIPLE_INSTANCES = 16, | 36 PLUGIN_QUIRK_DONT_ALLOW_MULTIPLE_INSTANCES = 16, |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 virtual WebPluginResourceClient* CreateResourceClient(int resource_id, | 132 virtual WebPluginResourceClient* CreateResourceClient(int resource_id, |
133 const std::string &url, | 133 const std::string &url, |
134 bool notify_needed, | 134 bool notify_needed, |
135 void *notify_data, | 135 void *notify_data, |
136 void* stream) = 0; | 136 void* stream) = 0; |
137 | 137 |
138 // Notifies the delegate about a Get/Post URL request getting routed. | 138 // Notifies the delegate about a Get/Post URL request getting routed. |
139 virtual void URLRequestRouted(const std::string&url, bool notify_needed, | 139 virtual void URLRequestRouted(const std::string&url, bool notify_needed, |
140 void* notify_data) = 0; | 140 void* notify_data) = 0; |
141 | 141 |
142 virtual bool IsWindowless() const { | 142 virtual bool IsWindowless() const; |
143 NOTREACHED(); | |
144 return false; | |
145 } | |
146 | 143 |
147 virtual const gfx::Rect& GetRect() const { | 144 virtual const gfx::Rect& GetRect() const; |
148 NOTREACHED(); | |
149 static gfx::Rect dummy; | |
150 return dummy; | |
151 } | |
152 | 145 |
153 virtual const gfx::Rect& GetClipRect() const { | 146 virtual const gfx::Rect& GetClipRect() const; |
154 NOTREACHED(); | |
155 return GetRect(); | |
156 } | |
157 | 147 |
158 #if defined(OS_WIN) | 148 #if defined(OS_WIN) |
159 // Returns a combinaison of PluginQuirks. | 149 // Returns a combinaison of PluginQuirks. |
160 virtual int GetQuirks() const { | 150 virtual int GetQuirks() const; |
161 NOTREACHED(); | |
162 return 0; | |
163 } | |
164 #endif | 151 #endif |
165 | 152 |
166 private: | 153 private: |
167 DISALLOW_EVIL_CONSTRUCTORS(WebPluginDelegate); | 154 DISALLOW_COPY_AND_ASSIGN(WebPluginDelegate); |
168 }; | 155 }; |
169 | 156 |
170 #endif // #ifndef WEBKIT_GLUE_WEBPLUGIN_DELEGATE_H_ | 157 #endif // #ifndef WEBKIT_GLUE_WEBPLUGIN_DELEGATE_H_ |
OLD | NEW |