OLD | NEW |
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 Loading... |
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) | 58 #if defined(OS_WIN) && !defined(USE_AURA) |
59 class WebPluginIMEWin; | 59 class WebPluginIMEWin; |
60 #endif // OS_WIN | 60 #endif // OS_WIN |
61 | 61 |
62 // An implementation of WebPluginDelegate that runs in the plugin process, | 62 // An implementation of WebPluginDelegate that runs in the plugin process, |
63 // proxied from the renderer by WebPluginDelegateProxy. | 63 // proxied from the renderer by WebPluginDelegateProxy. |
64 class WebPluginDelegateImpl : public WebPluginDelegate { | 64 class WebPluginDelegateImpl : public WebPluginDelegate { |
65 public: | 65 public: |
66 enum PluginQuirks { | 66 enum PluginQuirks { |
67 PLUGIN_QUIRK_SETWINDOW_TWICE = 1, // Win32 | 67 PLUGIN_QUIRK_SETWINDOW_TWICE = 1, // Win32 |
68 PLUGIN_QUIRK_THROTTLE_WM_USER_PLUS_ONE = 2, // Win32 | 68 PLUGIN_QUIRK_THROTTLE_WM_USER_PLUS_ONE = 2, // Win32 |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 | 140 |
141 // Returns the path for the library implementing this plugin. | 141 // Returns the path for the library implementing this plugin. |
142 FilePath GetPluginPath(); | 142 FilePath GetPluginPath(); |
143 | 143 |
144 // Returns a combination of PluginQuirks. | 144 // Returns a combination of PluginQuirks. |
145 int GetQuirks() const { return quirks_; } | 145 int GetQuirks() const { return quirks_; } |
146 | 146 |
147 // Informs the plugin that the view it is in has gained or lost focus. | 147 // Informs the plugin that the view it is in has gained or lost focus. |
148 void SetContentAreaHasFocus(bool has_focus); | 148 void SetContentAreaHasFocus(bool has_focus); |
149 | 149 |
150 #if defined(OS_WIN) | 150 #if defined(OS_WIN) && !defined(USE_AURA) |
151 // Informs the plug-in that an IME has changed its status. | 151 // Informs the plug-in that an IME has changed its status. |
152 void ImeCompositionUpdated(const string16& text, | 152 void ImeCompositionUpdated(const string16& text, |
153 const std::vector<int>& clauses, | 153 const std::vector<int>& clauses, |
154 const std::vector<int>& target, | 154 const std::vector<int>& target, |
155 int cursor_position); | 155 int cursor_position); |
156 | 156 |
157 // Informs the plugin that IME composition has completed./ If |text| is empty, | 157 // Informs the plugin that IME composition has completed./ If |text| is empty, |
158 // IME was cancelled. | 158 // IME was cancelled. |
159 void ImeCompositionCompleted(const string16& text); | 159 void ImeCompositionCompleted(const string16& text); |
160 | 160 |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
324 gfx::Rect windowed_last_pos_; | 324 gfx::Rect windowed_last_pos_; |
325 | 325 |
326 bool windowed_did_set_window_; | 326 bool windowed_did_set_window_; |
327 | 327 |
328 // used by windowed and windowless plugins | 328 // used by windowed and windowless plugins |
329 bool windowless_; | 329 bool windowless_; |
330 | 330 |
331 WebPlugin* plugin_; | 331 WebPlugin* plugin_; |
332 scoped_refptr<PluginInstance> instance_; | 332 scoped_refptr<PluginInstance> instance_; |
333 | 333 |
334 #if defined(OS_WIN) | 334 #if defined(OS_WIN) && !defined(USE_AURA) |
335 // Original wndproc before we subclassed. | 335 // Original wndproc before we subclassed. |
336 WNDPROC plugin_wnd_proc_; | 336 WNDPROC plugin_wnd_proc_; |
337 | 337 |
338 // Used to throttle WM_USER+1 messages in Flash. | 338 // Used to throttle WM_USER+1 messages in Flash. |
339 uint32 last_message_; | 339 uint32 last_message_; |
340 bool is_calling_wndproc; | 340 bool is_calling_wndproc; |
341 | 341 |
342 // An IME emulator used by a windowless plug-in to retrieve IME data through | 342 // An IME emulator used by a windowless plug-in to retrieve IME data through |
343 // IMM32 functions. | 343 // IMM32 functions. |
344 scoped_ptr<WebPluginIMEWin> plugin_ime_; | 344 scoped_ptr<WebPluginIMEWin> plugin_ime_; |
(...skipping 19 matching lines...) Expand all Loading... |
364 // Ensure pixmap_ exists and is at least width by height pixels. | 364 // Ensure pixmap_ exists and is at least width by height pixels. |
365 void EnsurePixmapAtLeastSize(int width, int height); | 365 void EnsurePixmapAtLeastSize(int width, int height); |
366 #endif | 366 #endif |
367 | 367 |
368 gfx::PluginWindowHandle parent_; | 368 gfx::PluginWindowHandle parent_; |
369 NPWindow window_; | 369 NPWindow window_; |
370 gfx::Rect window_rect_; | 370 gfx::Rect window_rect_; |
371 gfx::Rect clip_rect_; | 371 gfx::Rect clip_rect_; |
372 int quirks_; | 372 int quirks_; |
373 | 373 |
374 #if defined(OS_WIN) | 374 #if defined(OS_WIN) && !defined(USE_AURA) |
375 // Windowless plugins don't have keyboard focus causing issues with the | 375 // Windowless plugins don't have keyboard focus causing issues with the |
376 // plugin not receiving keyboard events if the plugin enters a modal | 376 // plugin not receiving keyboard events if the plugin enters a modal |
377 // loop like TrackPopupMenuEx or MessageBox, etc. | 377 // loop like TrackPopupMenuEx or MessageBox, etc. |
378 // This is a basic issue with windows activation and focus arising due to | 378 // This is a basic issue with windows activation and focus arising due to |
379 // the fact that these windows are created by different threads. Activation | 379 // the fact that these windows are created by different threads. Activation |
380 // and focus are thread specific states, and if the browser has focus, | 380 // and focus are thread specific states, and if the browser has focus, |
381 // the plugin may not have focus. | 381 // the plugin may not have focus. |
382 // To fix a majority of these activation issues we create a dummy visible | 382 // To fix a majority of these activation issues we create a dummy visible |
383 // child window to which we set focus whenever the windowless plugin | 383 // child window to which we set focus whenever the windowless plugin |
384 // receives a WM_LBUTTONDOWN/WM_RBUTTONDOWN message via NPP_HandleEvent. | 384 // receives a WM_LBUTTONDOWN/WM_RBUTTONDOWN message via NPP_HandleEvent. |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
550 // True if NPP_New did not return an error. | 550 // True if NPP_New did not return an error. |
551 bool creation_succeeded_; | 551 bool creation_succeeded_; |
552 | 552 |
553 DISALLOW_COPY_AND_ASSIGN(WebPluginDelegateImpl); | 553 DISALLOW_COPY_AND_ASSIGN(WebPluginDelegateImpl); |
554 }; | 554 }; |
555 | 555 |
556 } // namespace npapi | 556 } // namespace npapi |
557 } // namespace webkit | 557 } // namespace webkit |
558 | 558 |
559 #endif // WEBKIT_PLUGINS_NPAPI_WEBPLUGIN_DELEGATE_IMPL_H_ | 559 #endif // WEBKIT_PLUGINS_NPAPI_WEBPLUGIN_DELEGATE_IMPL_H_ |
OLD | NEW |