| 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 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 344 // loop like TrackPopupMenuEx or MessageBox, etc. | 344 // loop like TrackPopupMenuEx or MessageBox, etc. |
| 345 // This is a basic issue with windows activation and focus arising due to | 345 // 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 | 346 // the fact that these windows are created by different threads. Activation |
| 347 // and focus are thread specific states, and if the browser has focus, | 347 // and focus are thread specific states, and if the browser has focus, |
| 348 // the plugin may not have focus. | 348 // the plugin may not have focus. |
| 349 // To fix a majority of these activation issues we create a dummy visible | 349 // 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 | 350 // child window to which we set focus whenever the windowless plugin |
| 351 // receives a WM_LBUTTONDOWN/WM_RBUTTONDOWN message via NPP_HandleEvent. | 351 // receives a WM_LBUTTONDOWN/WM_RBUTTONDOWN message via NPP_HandleEvent. |
| 352 | 352 |
| 353 HWND dummy_window_for_activation_; | 353 HWND dummy_window_for_activation_; |
| 354 HWND parent_proxy_window_; |
| 354 bool CreateDummyWindowForActivation(); | 355 bool CreateDummyWindowForActivation(); |
| 355 | 356 |
| 356 // Returns true if the event passed in needs to be tracked for a potential | 357 // Returns true if the event passed in needs to be tracked for a potential |
| 357 // modal loop. | 358 // modal loop. |
| 358 static bool ShouldTrackEventForModalLoops(NPEvent* event); | 359 static bool ShouldTrackEventForModalLoops(NPEvent* event); |
| 359 | 360 |
| 360 // The message filter hook procedure, which tracks modal loops entered by | 361 // The message filter hook procedure, which tracks modal loops entered by |
| 361 // a plugin in the course of a NPP_HandleEvent call. | 362 // a plugin in the course of a NPP_HandleEvent call. |
| 362 static LRESULT CALLBACK HandleEventMessageFilterHook(int code, WPARAM wParam, | 363 static LRESULT CALLBACK HandleEventMessageFilterHook(int code, WPARAM wParam, |
| 363 LPARAM lParam); | 364 LPARAM lParam); |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 472 // Handle to the message filter hook | 473 // Handle to the message filter hook |
| 473 HHOOK handle_event_message_filter_hook_; | 474 HHOOK handle_event_message_filter_hook_; |
| 474 | 475 |
| 475 // Event which is set when the plugin enters a modal loop in the course | 476 // Event which is set when the plugin enters a modal loop in the course |
| 476 // of a NPP_HandleEvent call. | 477 // of a NPP_HandleEvent call. |
| 477 HANDLE handle_event_pump_messages_event_; | 478 HANDLE handle_event_pump_messages_event_; |
| 478 | 479 |
| 479 // This flag indicates whether we started tracking a user gesture message. | 480 // This flag indicates whether we started tracking a user gesture message. |
| 480 bool user_gesture_message_posted_; | 481 bool user_gesture_message_posted_; |
| 481 | 482 |
| 483 // Flag indicates this is the built-in Flash plugin. |
| 484 bool is_builtin_flash_; |
| 485 |
| 482 // Runnable Method Factory used to invoke the OnUserGestureEnd method | 486 // Runnable Method Factory used to invoke the OnUserGestureEnd method |
| 483 // asynchronously. | 487 // asynchronously. |
| 484 ScopedRunnableMethodFactory<WebPluginDelegateImpl> user_gesture_msg_factory_; | 488 ScopedRunnableMethodFactory<WebPluginDelegateImpl> user_gesture_msg_factory_; |
| 485 | 489 |
| 486 // Handle to the mouse hook installed for certain windowed plugins like | 490 // Handle to the mouse hook installed for certain windowed plugins like |
| 487 // flash. | 491 // flash. |
| 488 HHOOK mouse_hook_; | 492 HHOOK mouse_hook_; |
| 489 #endif | 493 #endif |
| 490 | 494 |
| 491 // Holds the depth of the HandleEvent callstack. | 495 // Holds the depth of the HandleEvent callstack. |
| (...skipping 20 matching lines...) Expand all Loading... |
| 512 // True if NPP_New did not return an error. | 516 // True if NPP_New did not return an error. |
| 513 bool creation_succeeded_; | 517 bool creation_succeeded_; |
| 514 | 518 |
| 515 DISALLOW_COPY_AND_ASSIGN(WebPluginDelegateImpl); | 519 DISALLOW_COPY_AND_ASSIGN(WebPluginDelegateImpl); |
| 516 }; | 520 }; |
| 517 | 521 |
| 518 } // namespace npapi | 522 } // namespace npapi |
| 519 } // namespace webkit | 523 } // namespace webkit |
| 520 | 524 |
| 521 #endif // WEBKIT_PLUGINS_NPAPI_WEBPLUGIN_DELEGATE_IMPL_H_ | 525 #endif // WEBKIT_PLUGINS_NPAPI_WEBPLUGIN_DELEGATE_IMPL_H_ |
| OLD | NEW |