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 #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 1341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1352 instance()->PopPopupsEnabledState(); | 1352 instance()->PopPopupsEnabledState(); |
1353 } | 1353 } |
1354 | 1354 |
1355 // Flash and SilverLight always return false, even when they swallow the | 1355 // Flash and SilverLight always return false, even when they swallow the |
1356 // event. Flash does this because it passes the event to its window proc, | 1356 // event. Flash does this because it passes the event to its window proc, |
1357 // which is supposed to return 0 if an event was handled. There are few | 1357 // which is supposed to return 0 if an event was handled. There are few |
1358 // exceptions, such as IME, where it sometimes returns true. | 1358 // exceptions, such as IME, where it sometimes returns true. |
1359 ret = true; | 1359 ret = true; |
1360 | 1360 |
1361 if (np_event.event == WM_MOUSEMOVE) { | 1361 if (np_event.event == WM_MOUSEMOVE) { |
| 1362 current_windowless_cursor_.InitFromExternalCursor(GetCursor()); |
1362 // Snag a reference to the current cursor ASAP in case the plugin modified | 1363 // Snag a reference to the current cursor ASAP in case the plugin modified |
1363 // it. There is a nasty race condition here with the multiprocess browser | 1364 // it. There is a nasty race condition here with the multiprocess browser |
1364 // as someone might be setting the cursor in the main process as well. | 1365 // as someone might be setting the cursor in the main process as well. |
1365 current_windowless_cursor_.GetCursorInfo(cursor_info); | 1366 current_windowless_cursor_.GetCursorInfo(cursor_info); |
1366 } | 1367 } |
1367 | 1368 |
1368 handle_event_depth_--; | 1369 handle_event_depth_--; |
1369 | 1370 |
1370 g_current_plugin_instance = last_plugin_instance; | 1371 g_current_plugin_instance = last_plugin_instance; |
1371 | 1372 |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1453 // instantiated on the plugin thread. This causes annoying cursor flicker | 1454 // instantiated on the plugin thread. This causes annoying cursor flicker |
1454 // when the mouse is moved on a foreground tab, with a windowless plugin | 1455 // when the mouse is moved on a foreground tab, with a windowless plugin |
1455 // instance in a background tab. We just ignore the call here. | 1456 // instance in a background tab. We just ignore the call here. |
1456 if (!g_current_plugin_instance) { | 1457 if (!g_current_plugin_instance) { |
1457 HCURSOR current_cursor = GetCursor(); | 1458 HCURSOR current_cursor = GetCursor(); |
1458 if (current_cursor != cursor) { | 1459 if (current_cursor != cursor) { |
1459 ::SetCursor(cursor); | 1460 ::SetCursor(cursor); |
1460 } | 1461 } |
1461 return current_cursor; | 1462 return current_cursor; |
1462 } | 1463 } |
1463 | 1464 return ::SetCursor(cursor); |
1464 if (!g_current_plugin_instance->IsWindowless()) { | |
1465 return ::SetCursor(cursor); | |
1466 } | |
1467 | |
1468 // It is ok to pass NULL here to GetCursor as we are not looking for cursor | |
1469 // types defined by Webkit. | |
1470 HCURSOR previous_cursor = | |
1471 g_current_plugin_instance->current_windowless_cursor_.GetCursor(NULL); | |
1472 | |
1473 g_current_plugin_instance->current_windowless_cursor_.InitFromExternalCursor( | |
1474 cursor); | |
1475 return previous_cursor; | |
1476 } | 1465 } |
1477 | 1466 |
1478 LONG WINAPI WebPluginDelegateImpl::RegEnumKeyExWPatch( | 1467 LONG WINAPI WebPluginDelegateImpl::RegEnumKeyExWPatch( |
1479 HKEY key, DWORD index, LPWSTR name, LPDWORD name_size, LPDWORD reserved, | 1468 HKEY key, DWORD index, LPWSTR name, LPDWORD name_size, LPDWORD reserved, |
1480 LPWSTR class_name, LPDWORD class_size, PFILETIME last_write_time) { | 1469 LPWSTR class_name, LPDWORD class_size, PFILETIME last_write_time) { |
1481 DWORD orig_size = *name_size; | 1470 DWORD orig_size = *name_size; |
1482 LONG rv = RegEnumKeyExW(key, index, name, name_size, reserved, class_name, | 1471 LONG rv = RegEnumKeyExW(key, index, name, name_size, reserved, class_name, |
1483 class_size, last_write_time); | 1472 class_size, last_write_time); |
1484 if (rv == ERROR_SUCCESS && | 1473 if (rv == ERROR_SUCCESS && |
1485 GetKeyPath(key).find(L"Microsoft\\MediaPlayer\\ShimInclusionList") != | 1474 GetKeyPath(key).find(L"Microsoft\\MediaPlayer\\ShimInclusionList") != |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1517 ::ReleaseCapture(); | 1506 ::ReleaseCapture(); |
1518 break; | 1507 break; |
1519 | 1508 |
1520 default: | 1509 default: |
1521 break; | 1510 break; |
1522 } | 1511 } |
1523 } | 1512 } |
1524 | 1513 |
1525 } // namespace npapi | 1514 } // namespace npapi |
1526 } // namespace webkit | 1515 } // namespace webkit |
OLD | NEW |