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_PLUGIN_WEBPLUGIN_DELEGATE_IMPL_H_ | 5 #ifndef WEBKIT_GLUE_PLUGIN_WEBPLUGIN_DELEGATE_IMPL_H_ |
6 #define WEBKIT_GLUE_PLUGIN_WEBPLUGIN_DELEGATE_IMPL_H_ | 6 #define WEBKIT_GLUE_PLUGIN_WEBPLUGIN_DELEGATE_IMPL_H_ |
7 | 7 |
8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
9 | 9 |
10 #include <string> | 10 #include <string> |
11 #include <list> | 11 #include <list> |
12 | 12 |
13 #include "base/file_path.h" | 13 #include "base/file_path.h" |
14 #include "base/gfx/native_widget_types.h" | 14 #include "base/gfx/native_widget_types.h" |
15 #include "base/gfx/rect.h" | 15 #include "base/gfx/rect.h" |
16 #include "base/ref_counted.h" | 16 #include "base/ref_counted.h" |
17 #include "base/task.h" | 17 #include "base/task.h" |
18 #include "third_party/npapi/bindings/npapi.h" | 18 #include "third_party/npapi/bindings/npapi.h" |
19 #include "webkit/glue/webcursor.h" | 19 #include "webkit/glue/webcursor.h" |
20 #include "webkit/glue/webplugin_delegate.h" | 20 #include "webkit/glue/webplugin_delegate.h" |
21 | 21 |
22 #if defined(OS_LINUX) | 22 #if defined(USE_X11) |
23 typedef struct _GdkDrawable GdkPixmap; | 23 typedef struct _GdkDrawable GdkPixmap; |
24 #endif | 24 #endif |
25 | 25 |
26 namespace NPAPI { | 26 namespace NPAPI { |
27 class PluginInstance; | 27 class PluginInstance; |
28 } | 28 } |
29 | 29 |
30 // An implementation of WebPluginDelegate that proxies all calls to | 30 // An implementation of WebPluginDelegate that proxies all calls to |
31 // the plugin process. | 31 // the plugin process. |
32 class WebPluginDelegateImpl : public webkit_glue::WebPluginDelegate { | 32 class WebPluginDelegateImpl : public webkit_glue::WebPluginDelegate { |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 | 210 |
211 #if defined(OS_WIN) | 211 #if defined(OS_WIN) |
212 // Original wndproc before we subclassed. | 212 // Original wndproc before we subclassed. |
213 WNDPROC plugin_wnd_proc_; | 213 WNDPROC plugin_wnd_proc_; |
214 | 214 |
215 // Used to throttle WM_USER+1 messages in Flash. | 215 // Used to throttle WM_USER+1 messages in Flash. |
216 uint32 last_message_; | 216 uint32 last_message_; |
217 bool is_calling_wndproc; | 217 bool is_calling_wndproc; |
218 #endif // OS_WIN | 218 #endif // OS_WIN |
219 | 219 |
220 #if defined(OS_LINUX) | 220 #if defined(USE_X11) |
221 // The pixmap we're drawing into, for a windowless plugin. | 221 // The pixmap we're drawing into, for a windowless plugin. |
222 GdkPixmap* pixmap_; | 222 GdkPixmap* pixmap_; |
223 double first_event_time_; | 223 double first_event_time_; |
224 | 224 |
225 // On Linux some plugins assume that the GtkSocket container is in the same | 225 // On Linux some plugins assume that the GtkSocket container is in the same |
226 // process. So we create a GtkPlug to plug into the browser's container, and | 226 // process. So we create a GtkPlug to plug into the browser's container, and |
227 // a GtkSocket to hold the plugin. We then send the GtkPlug to the browser | 227 // a GtkSocket to hold the plugin. We then send the GtkPlug to the browser |
228 // process. | 228 // process. |
229 GtkWidget* plug_; | 229 GtkWidget* plug_; |
230 GtkWidget* socket_; | 230 GtkWidget* socket_; |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
291 #endif | 291 #endif |
292 | 292 |
293 // Holds the depth of the HandleEvent callstack. | 293 // Holds the depth of the HandleEvent callstack. |
294 int handle_event_depth_; | 294 int handle_event_depth_; |
295 | 295 |
296 // This flag indicates whether we started tracking a user gesture message. | 296 // This flag indicates whether we started tracking a user gesture message. |
297 bool user_gesture_message_posted_; | 297 bool user_gesture_message_posted_; |
298 | 298 |
299 // Runnable Method Factory used to invoke the OnUserGestureEnd method | 299 // Runnable Method Factory used to invoke the OnUserGestureEnd method |
300 // asynchronously. | 300 // asynchronously. |
301 #if !defined(OS_LINUX) | 301 #if !defined(USE_X11) |
302 ScopedRunnableMethodFactory<WebPluginDelegateImpl> user_gesture_msg_factory_; | 302 ScopedRunnableMethodFactory<WebPluginDelegateImpl> user_gesture_msg_factory_; |
303 #endif | 303 #endif |
304 | 304 |
305 #if defined(OS_WIN) | 305 #if defined(OS_WIN) |
306 // TrackPopupMenu interceptor. Parameters are the same as the Win32 function | 306 // TrackPopupMenu interceptor. Parameters are the same as the Win32 function |
307 // TrackPopupMenu. | 307 // TrackPopupMenu. |
308 static BOOL WINAPI TrackPopupMenuPatch(HMENU menu, unsigned int flags, int x, | 308 static BOOL WINAPI TrackPopupMenuPatch(HMENU menu, unsigned int flags, int x, |
309 int y, int reserved, HWND window, | 309 int y, int reserved, HWND window, |
310 const RECT* rect); | 310 const RECT* rect); |
311 | 311 |
(...skipping 20 matching lines...) Expand all Loading... |
332 | 332 |
333 // Holds the current cursor set by the windowless plugin. | 333 // Holds the current cursor set by the windowless plugin. |
334 WebCursor current_windowless_cursor_; | 334 WebCursor current_windowless_cursor_; |
335 | 335 |
336 friend class webkit_glue::WebPluginDelegate; | 336 friend class webkit_glue::WebPluginDelegate; |
337 | 337 |
338 DISALLOW_EVIL_CONSTRUCTORS(WebPluginDelegateImpl); | 338 DISALLOW_EVIL_CONSTRUCTORS(WebPluginDelegateImpl); |
339 }; | 339 }; |
340 | 340 |
341 #endif // #ifndef WEBKIT_GLUE_PLUGIN_WEBPLUGIN_DELEGATE_IMPL_H_ | 341 #endif // #ifndef WEBKIT_GLUE_PLUGIN_WEBPLUGIN_DELEGATE_IMPL_H_ |
OLD | NEW |