| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "webkit/plugins/npapi/webplugin_delegate_impl.h" | 5 #include "webkit/plugins/npapi/webplugin_delegate_impl.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 1411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1422 return false; | 1422 return false; |
| 1423 } | 1423 } |
| 1424 | 1424 |
| 1425 if (GetQuirks() & PLUGIN_QUIRK_PATCH_GETKEYSTATE) { | 1425 if (GetQuirks() & PLUGIN_QUIRK_PATCH_GETKEYSTATE) { |
| 1426 if (np_event.event == WM_KEYDOWN) | 1426 if (np_event.event == WM_KEYDOWN) |
| 1427 SetSavedKeyState(np_event.wParam); | 1427 SetSavedKeyState(np_event.wParam); |
| 1428 else if (np_event.event == WM_KEYUP) | 1428 else if (np_event.event == WM_KEYUP) |
| 1429 UnsetSavedKeyState(np_event.wParam); | 1429 UnsetSavedKeyState(np_event.wParam); |
| 1430 } | 1430 } |
| 1431 | 1431 |
| 1432 // Allow this plug-in to access this IME emulator through IMM32 API while the |
| 1433 // plug-in is processing this event. |
| 1434 if (GetQuirks() & PLUGIN_QUIRK_EMULATE_IME) { |
| 1435 if (!plugin_ime_.get()) |
| 1436 plugin_ime_.reset(new WebPluginIMEWin); |
| 1437 } |
| 1438 WebPluginIMEWin::ScopedLock lock(plugin_ime_.get()); |
| 1439 |
| 1432 HWND last_focus_window = NULL; | 1440 HWND last_focus_window = NULL; |
| 1433 | 1441 |
| 1434 if (ShouldTrackEventForModalLoops(&np_event)) { | 1442 if (ShouldTrackEventForModalLoops(&np_event)) { |
| 1435 // A windowless plugin can enter a modal loop in a NPP_HandleEvent call. | 1443 // A windowless plugin can enter a modal loop in a NPP_HandleEvent call. |
| 1436 // For e.g. Flash puts up a context menu when we right click on the | 1444 // For e.g. Flash puts up a context menu when we right click on the |
| 1437 // windowless plugin area. We detect this by setting up a message filter | 1445 // windowless plugin area. We detect this by setting up a message filter |
| 1438 // hook pror to calling NPP_HandleEvent on the plugin and unhook on | 1446 // hook pror to calling NPP_HandleEvent on the plugin and unhook on |
| 1439 // return from NPP_HandleEvent. If the plugin does enter a modal loop | 1447 // return from NPP_HandleEvent. If the plugin does enter a modal loop |
| 1440 // in that context we unhook on receiving the first notification in | 1448 // in that context we unhook on receiving the first notification in |
| 1441 // the message filter hook. | 1449 // the message filter hook. |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1664 ::ReleaseCapture(); | 1672 ::ReleaseCapture(); |
| 1665 break; | 1673 break; |
| 1666 | 1674 |
| 1667 default: | 1675 default: |
| 1668 break; | 1676 break; |
| 1669 } | 1677 } |
| 1670 } | 1678 } |
| 1671 | 1679 |
| 1672 } // namespace npapi | 1680 } // namespace npapi |
| 1673 } // namespace webkit | 1681 } // namespace webkit |
| OLD | NEW |