Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(158)

Side by Side Diff: webkit/plugins/npapi/webplugin_delegate_impl.h

Issue 7082034: Send IME events to windowless plug-ins (Chromium side) (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_PLUGINS_NPAPI_WEBPLUGIN_DELEGATE_IMPL_H_ 5 #ifndef WEBKIT_PLUGINS_NPAPI_WEBPLUGIN_DELEGATE_IMPL_H_
6 #define WEBKIT_PLUGINS_NPAPI_WEBPLUGIN_DELEGATE_IMPL_H_ 6 #define WEBKIT_PLUGINS_NPAPI_WEBPLUGIN_DELEGATE_IMPL_H_
7 7
8 #include <string> 8 #include <string>
9 #include <list> 9 #include <list>
10 10
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 class PluginInstance; 48 class PluginInstance;
49 49
50 #if defined(OS_MACOSX) 50 #if defined(OS_MACOSX)
51 class WebPluginAcceleratedSurface; 51 class WebPluginAcceleratedSurface;
52 class ExternalDragTracker; 52 class ExternalDragTracker;
53 #ifndef NP_NO_QUICKDRAW 53 #ifndef NP_NO_QUICKDRAW
54 class QuickDrawDrawingManager; 54 class QuickDrawDrawingManager;
55 #endif // NP_NO_QUICKDRAW 55 #endif // NP_NO_QUICKDRAW
56 #endif // OS_MACOSX 56 #endif // OS_MACOSX
57 57
58 #if defined(OS_WIN)
59 class WebPluginIMEWin;
60 #endif // OS_WIN
61
58 // An implementation of WebPluginDelegate that runs in the plugin process, 62 // An implementation of WebPluginDelegate that runs in the plugin process,
59 // proxied from the renderer by WebPluginDelegateProxy. 63 // proxied from the renderer by WebPluginDelegateProxy.
60 class WebPluginDelegateImpl : public WebPluginDelegate { 64 class WebPluginDelegateImpl : public WebPluginDelegate {
61 public: 65 public:
62 enum PluginQuirks { 66 enum PluginQuirks {
63 PLUGIN_QUIRK_SETWINDOW_TWICE = 1, // Win32 67 PLUGIN_QUIRK_SETWINDOW_TWICE = 1, // Win32
64 PLUGIN_QUIRK_THROTTLE_WM_USER_PLUS_ONE = 2, // Win32 68 PLUGIN_QUIRK_THROTTLE_WM_USER_PLUS_ONE = 2, // Win32
65 PLUGIN_QUIRK_DONT_CALL_WND_PROC_RECURSIVELY = 4, // Win32 69 PLUGIN_QUIRK_DONT_CALL_WND_PROC_RECURSIVELY = 4, // Win32
66 PLUGIN_QUIRK_DONT_SET_NULL_WINDOW_HANDLE_ON_DESTROY = 8, // Win32 70 PLUGIN_QUIRK_DONT_SET_NULL_WINDOW_HANDLE_ON_DESTROY = 8, // Win32
67 PLUGIN_QUIRK_DONT_ALLOW_MULTIPLE_INSTANCES = 16, // Win32 71 PLUGIN_QUIRK_DONT_ALLOW_MULTIPLE_INSTANCES = 16, // Win32
68 PLUGIN_QUIRK_DIE_AFTER_UNLOAD = 32, // Win32 72 PLUGIN_QUIRK_DIE_AFTER_UNLOAD = 32, // Win32
69 PLUGIN_QUIRK_PATCH_SETCURSOR = 64, // Win32 73 PLUGIN_QUIRK_PATCH_SETCURSOR = 64, // Win32
70 PLUGIN_QUIRK_BLOCK_NONSTANDARD_GETURL_REQUESTS = 128, // Win32 74 PLUGIN_QUIRK_BLOCK_NONSTANDARD_GETURL_REQUESTS = 128, // Win32
71 PLUGIN_QUIRK_WINDOWLESS_OFFSET_WINDOW_TO_DRAW = 256, // Linux 75 PLUGIN_QUIRK_WINDOWLESS_OFFSET_WINDOW_TO_DRAW = 256, // Linux
72 PLUGIN_QUIRK_WINDOWLESS_INVALIDATE_AFTER_SET_WINDOW = 512, // Linux 76 PLUGIN_QUIRK_WINDOWLESS_INVALIDATE_AFTER_SET_WINDOW = 512, // Linux
73 PLUGIN_QUIRK_NO_WINDOWLESS = 1024, // Windows 77 PLUGIN_QUIRK_NO_WINDOWLESS = 1024, // Windows
74 PLUGIN_QUIRK_PATCH_REGENUMKEYEXW = 2048, // Windows 78 PLUGIN_QUIRK_PATCH_REGENUMKEYEXW = 2048, // Windows
75 PLUGIN_QUIRK_ALWAYS_NOTIFY_SUCCESS = 4096, // Windows 79 PLUGIN_QUIRK_ALWAYS_NOTIFY_SUCCESS = 4096, // Windows
76 PLUGIN_QUIRK_ALLOW_FASTER_QUICKDRAW_PATH = 8192, // Mac 80 PLUGIN_QUIRK_ALLOW_FASTER_QUICKDRAW_PATH = 8192, // Mac
77 PLUGIN_QUIRK_HANDLE_MOUSE_CAPTURE = 16384, // Windows 81 PLUGIN_QUIRK_HANDLE_MOUSE_CAPTURE = 16384, // Windows
78 PLUGIN_QUIRK_WINDOWLESS_NO_RIGHT_CLICK = 32768, // Linux 82 PLUGIN_QUIRK_WINDOWLESS_NO_RIGHT_CLICK = 32768, // Linux
79 PLUGIN_QUIRK_IGNORE_FIRST_SETWINDOW_CALL = 65536, // Windows. 83 PLUGIN_QUIRK_IGNORE_FIRST_SETWINDOW_CALL = 65536, // Windows.
84 PLUGIN_QUIRK_EMULATE_IME = 131072, // Windows.
80 }; 85 };
81 86
82 static WebPluginDelegateImpl* Create(const FilePath& filename, 87 static WebPluginDelegateImpl* Create(const FilePath& filename,
83 const std::string& mime_type, 88 const std::string& mime_type,
84 gfx::PluginWindowHandle containing_view); 89 gfx::PluginWindowHandle containing_view);
85 90
86 static bool IsPluginDelegateWindow(gfx::NativeWindow window); 91 static bool IsPluginDelegateWindow(gfx::NativeWindow window);
87 static bool GetPluginNameFromWindow(gfx::NativeWindow window, 92 static bool GetPluginNameFromWindow(gfx::NativeWindow window,
88 string16* plugin_name); 93 string16* plugin_name);
89 94
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 138
134 // Returns the path for the library implementing this plugin. 139 // Returns the path for the library implementing this plugin.
135 FilePath GetPluginPath(); 140 FilePath GetPluginPath();
136 141
137 // Returns a combination of PluginQuirks. 142 // Returns a combination of PluginQuirks.
138 int GetQuirks() const { return quirks_; } 143 int GetQuirks() const { return quirks_; }
139 144
140 // Informs the plugin that the view it is in has gained or lost focus. 145 // Informs the plugin that the view it is in has gained or lost focus.
141 void SetContentAreaHasFocus(bool has_focus); 146 void SetContentAreaHasFocus(bool has_focus);
142 147
148 #if defined(OS_WIN)
149 // Returns the IME status retrieved from a plug-in.
150 bool GetIMEStatus(int* input_type, gfx::Rect* caret_rect);
151 #endif
152
143 #if defined(OS_MACOSX) 153 #if defined(OS_MACOSX)
144 // Informs the plugin that the geometry has changed, as with UpdateGeometry, 154 // Informs the plugin that the geometry has changed, as with UpdateGeometry,
145 // but also includes the new buffer context for that new geometry. 155 // but also includes the new buffer context for that new geometry.
146 void UpdateGeometryAndContext(const gfx::Rect& window_rect, 156 void UpdateGeometryAndContext(const gfx::Rect& window_rect,
147 const gfx::Rect& clip_rect, 157 const gfx::Rect& clip_rect,
148 gfx::NativeDrawingContext context); 158 gfx::NativeDrawingContext context);
149 // Informs the delegate that the plugin called NPN_Invalidate*. Used as a 159 // Informs the delegate that the plugin called NPN_Invalidate*. Used as a
150 // trigger for Core Animation drawing. 160 // trigger for Core Animation drawing.
151 void PluginDidInvalidate(); 161 void PluginDidInvalidate();
152 // Returns the delegate currently processing events. 162 // Returns the delegate currently processing events.
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
304 WebPlugin* plugin_; 314 WebPlugin* plugin_;
305 scoped_refptr<PluginInstance> instance_; 315 scoped_refptr<PluginInstance> instance_;
306 316
307 #if defined(OS_WIN) 317 #if defined(OS_WIN)
308 // Original wndproc before we subclassed. 318 // Original wndproc before we subclassed.
309 WNDPROC plugin_wnd_proc_; 319 WNDPROC plugin_wnd_proc_;
310 320
311 // Used to throttle WM_USER+1 messages in Flash. 321 // Used to throttle WM_USER+1 messages in Flash.
312 uint32 last_message_; 322 uint32 last_message_;
313 bool is_calling_wndproc; 323 bool is_calling_wndproc;
324
325 // An IME emulator used by a windowless plug-in to retrieve IME data through
326 // IMM32 functions.
327 scoped_ptr<WebPluginIMEWin> plugin_ime_;
314 #endif // defined(OS_WIN) 328 #endif // defined(OS_WIN)
315 329
316 #if defined(USE_X11) 330 #if defined(USE_X11)
317 // The SHM pixmap for a windowless plugin. 331 // The SHM pixmap for a windowless plugin.
318 XID windowless_shm_pixmap_; 332 XID windowless_shm_pixmap_;
319 333
320 // The pixmap we're drawing into, for a windowless plugin. 334 // The pixmap we're drawing into, for a windowless plugin.
321 GdkPixmap* pixmap_; 335 GdkPixmap* pixmap_;
322 double first_event_time_; 336 double first_event_time_;
323 337
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
369 const RECT* rect); 383 const RECT* rect);
370 384
371 // SetCursor interceptor for windowless plugins. 385 // SetCursor interceptor for windowless plugins.
372 static HCURSOR WINAPI SetCursorPatch(HCURSOR cursor); 386 static HCURSOR WINAPI SetCursorPatch(HCURSOR cursor);
373 387
374 // RegEnumKeyExW interceptor. 388 // RegEnumKeyExW interceptor.
375 static LONG WINAPI RegEnumKeyExWPatch( 389 static LONG WINAPI RegEnumKeyExWPatch(
376 HKEY key, DWORD index, LPWSTR name, LPDWORD name_size, LPDWORD reserved, 390 HKEY key, DWORD index, LPWSTR name, LPDWORD name_size, LPDWORD reserved,
377 LPWSTR class_name, LPDWORD class_size, PFILETIME last_write_time); 391 LPWSTR class_name, LPDWORD class_size, PFILETIME last_write_time);
378 392
393 // GetProcAddress intercepter for windowless plugins.
394 static FARPROC WINAPI GetProcAddressPatch(HMODULE module, LPCSTR name);
395
379 // The mouse hook proc which handles mouse capture in windowed plugins. 396 // The mouse hook proc which handles mouse capture in windowed plugins.
380 static LRESULT CALLBACK MouseHookProc(int code, WPARAM wParam, 397 static LRESULT CALLBACK MouseHookProc(int code, WPARAM wParam,
381 LPARAM lParam); 398 LPARAM lParam);
382 399
383 // Calls SetCapture/ReleaseCapture based on the message type. 400 // Calls SetCapture/ReleaseCapture based on the message type.
384 static void HandleCaptureForMessage(HWND window, UINT message); 401 static void HandleCaptureForMessage(HWND window, UINT message);
385 402
386 #elif defined(OS_MACOSX) 403 #elif defined(OS_MACOSX)
387 // Sets window_rect_ to |rect| 404 // Sets window_rect_ to |rect|
388 void SetPluginRect(const gfx::Rect& rect); 405 void SetPluginRect(const gfx::Rect& rect);
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
512 // True if NPP_New did not return an error. 529 // True if NPP_New did not return an error.
513 bool creation_succeeded_; 530 bool creation_succeeded_;
514 531
515 DISALLOW_COPY_AND_ASSIGN(WebPluginDelegateImpl); 532 DISALLOW_COPY_AND_ASSIGN(WebPluginDelegateImpl);
516 }; 533 };
517 534
518 } // namespace npapi 535 } // namespace npapi
519 } // namespace webkit 536 } // namespace webkit
520 537
521 #endif // WEBKIT_PLUGINS_NPAPI_WEBPLUGIN_DELEGATE_IMPL_H_ 538 #endif // WEBKIT_PLUGINS_NPAPI_WEBPLUGIN_DELEGATE_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698