| 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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 PLUGIN_QUIRK_BLOCK_NONSTANDARD_GETURL_REQUESTS = 128, // Win32 | 70 PLUGIN_QUIRK_BLOCK_NONSTANDARD_GETURL_REQUESTS = 128, // Win32 |
| 71 PLUGIN_QUIRK_WINDOWLESS_OFFSET_WINDOW_TO_DRAW = 256, // Linux | 71 PLUGIN_QUIRK_WINDOWLESS_OFFSET_WINDOW_TO_DRAW = 256, // Linux |
| 72 PLUGIN_QUIRK_WINDOWLESS_INVALIDATE_AFTER_SET_WINDOW = 512, // Linux | 72 PLUGIN_QUIRK_WINDOWLESS_INVALIDATE_AFTER_SET_WINDOW = 512, // Linux |
| 73 PLUGIN_QUIRK_NO_WINDOWLESS = 1024, // Windows | 73 PLUGIN_QUIRK_NO_WINDOWLESS = 1024, // Windows |
| 74 PLUGIN_QUIRK_PATCH_REGENUMKEYEXW = 2048, // Windows | 74 PLUGIN_QUIRK_PATCH_REGENUMKEYEXW = 2048, // Windows |
| 75 PLUGIN_QUIRK_ALWAYS_NOTIFY_SUCCESS = 4096, // Windows | 75 PLUGIN_QUIRK_ALWAYS_NOTIFY_SUCCESS = 4096, // Windows |
| 76 PLUGIN_QUIRK_ALLOW_FASTER_QUICKDRAW_PATH = 8192, // Mac | 76 PLUGIN_QUIRK_ALLOW_FASTER_QUICKDRAW_PATH = 8192, // Mac |
| 77 PLUGIN_QUIRK_HANDLE_MOUSE_CAPTURE = 16384, // Windows | 77 PLUGIN_QUIRK_HANDLE_MOUSE_CAPTURE = 16384, // Windows |
| 78 PLUGIN_QUIRK_WINDOWLESS_NO_RIGHT_CLICK = 32768, // Linux | 78 PLUGIN_QUIRK_WINDOWLESS_NO_RIGHT_CLICK = 32768, // Linux |
| 79 PLUGIN_QUIRK_IGNORE_FIRST_SETWINDOW_CALL = 65536, // Windows. | 79 PLUGIN_QUIRK_IGNORE_FIRST_SETWINDOW_CALL = 65536, // Windows. |
| 80 PLUGIN_QUIRK_REPARENT_IN_BROWSER = 131072, // Windows |
| 80 }; | 81 }; |
| 81 | 82 |
| 82 static WebPluginDelegateImpl* Create(const FilePath& filename, | 83 static WebPluginDelegateImpl* Create(const FilePath& filename, |
| 83 const std::string& mime_type, | 84 const std::string& mime_type, |
| 84 gfx::PluginWindowHandle containing_view); | 85 gfx::PluginWindowHandle containing_view); |
| 85 | 86 |
| 86 static bool IsPluginDelegateWindow(gfx::NativeWindow window); | 87 static bool IsPluginDelegateWindow(gfx::NativeWindow window); |
| 87 static bool GetPluginNameFromWindow(gfx::NativeWindow window, | 88 static bool GetPluginNameFromWindow(gfx::NativeWindow window, |
| 88 string16* plugin_name); | 89 string16* plugin_name); |
| 89 | 90 |
| (...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 344 // loop like TrackPopupMenuEx or MessageBox, etc. | 345 // loop like TrackPopupMenuEx or MessageBox, etc. |
| 345 // This is a basic issue with windows activation and focus arising due to | 346 // This is a basic issue with windows activation and focus arising due to |
| 346 // the fact that these windows are created by different threads. Activation | 347 // the fact that these windows are created by different threads. Activation |
| 347 // and focus are thread specific states, and if the browser has focus, | 348 // and focus are thread specific states, and if the browser has focus, |
| 348 // the plugin may not have focus. | 349 // the plugin may not have focus. |
| 349 // To fix a majority of these activation issues we create a dummy visible | 350 // To fix a majority of these activation issues we create a dummy visible |
| 350 // child window to which we set focus whenever the windowless plugin | 351 // child window to which we set focus whenever the windowless plugin |
| 351 // receives a WM_LBUTTONDOWN/WM_RBUTTONDOWN message via NPP_HandleEvent. | 352 // receives a WM_LBUTTONDOWN/WM_RBUTTONDOWN message via NPP_HandleEvent. |
| 352 | 353 |
| 353 HWND dummy_window_for_activation_; | 354 HWND dummy_window_for_activation_; |
| 355 HWND parent_proxy_window_; |
| 354 bool CreateDummyWindowForActivation(); | 356 bool CreateDummyWindowForActivation(); |
| 355 | 357 |
| 356 // Returns true if the event passed in needs to be tracked for a potential | 358 // Returns true if the event passed in needs to be tracked for a potential |
| 357 // modal loop. | 359 // modal loop. |
| 358 static bool ShouldTrackEventForModalLoops(NPEvent* event); | 360 static bool ShouldTrackEventForModalLoops(NPEvent* event); |
| 359 | 361 |
| 360 // The message filter hook procedure, which tracks modal loops entered by | 362 // The message filter hook procedure, which tracks modal loops entered by |
| 361 // a plugin in the course of a NPP_HandleEvent call. | 363 // a plugin in the course of a NPP_HandleEvent call. |
| 362 static LRESULT CALLBACK HandleEventMessageFilterHook(int code, WPARAM wParam, | 364 static LRESULT CALLBACK HandleEventMessageFilterHook(int code, WPARAM wParam, |
| 363 LPARAM lParam); | 365 LPARAM lParam); |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 512 // True if NPP_New did not return an error. | 514 // True if NPP_New did not return an error. |
| 513 bool creation_succeeded_; | 515 bool creation_succeeded_; |
| 514 | 516 |
| 515 DISALLOW_COPY_AND_ASSIGN(WebPluginDelegateImpl); | 517 DISALLOW_COPY_AND_ASSIGN(WebPluginDelegateImpl); |
| 516 }; | 518 }; |
| 517 | 519 |
| 518 } // namespace npapi | 520 } // namespace npapi |
| 519 } // namespace webkit | 521 } // namespace webkit |
| 520 | 522 |
| 521 #endif // WEBKIT_PLUGINS_NPAPI_WEBPLUGIN_DELEGATE_IMPL_H_ | 523 #endif // WEBKIT_PLUGINS_NPAPI_WEBPLUGIN_DELEGATE_IMPL_H_ |
| OLD | NEW |