summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorstuartmorgan@chromium.org <stuartmorgan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-27 01:22:58 +0000
committerstuartmorgan@chromium.org <stuartmorgan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-27 01:22:58 +0000
commit6a4926955cf4561bbc30631586fccd143f1edfe2 (patch)
treef0830f48136f1847f5169ffaf6d92dddf57111eb
parent41fe40d3b37f05eca4f67f7b38ae66aa33689e0a (diff)
downloadchromium_src-6a4926955cf4561bbc30631586fccd143f1edfe2.zip
chromium_src-6a4926955cf4561bbc30631586fccd143f1edfe2.tar.gz
chromium_src-6a4926955cf4561bbc30631586fccd143f1edfe2.tar.bz2
Send Cocoa-event plugins drags, rather than moves, when a mouse button is down
BUG=32996 TEST=Mouseover and drag should work correctly in Google Earth and Flash 10.1. Review URL: http://codereview.chromium.org/551154 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@37204 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--webkit/glue/plugins/webplugin_delegate_impl_mac.mm9
1 files changed, 7 insertions, 2 deletions
diff --git a/webkit/glue/plugins/webplugin_delegate_impl_mac.mm b/webkit/glue/plugins/webplugin_delegate_impl_mac.mm
index 205c874..7783b62 100644
--- a/webkit/glue/plugins/webplugin_delegate_impl_mac.mm
+++ b/webkit/glue/plugins/webplugin_delegate_impl_mac.mm
@@ -742,9 +742,14 @@ static bool NPCocoaEventFromWebMouseEvent(const WebMouseEvent& event,
case WebInputEvent::MouseUp:
np_cocoa_event->type = NPCocoaEventMouseUp;
return true;
- case WebInputEvent::MouseMove:
- np_cocoa_event->type = NPCocoaEventMouseMoved;
+ case WebInputEvent::MouseMove: {
+ bool mouse_is_down = (event.modifiers & WebInputEvent::LeftButtonDown) ||
+ (event.modifiers & WebInputEvent::RightButtonDown) ||
+ (event.modifiers & WebInputEvent::MiddleButtonDown);
+ np_cocoa_event->type = mouse_is_down ? NPCocoaEventMouseDragged
+ : NPCocoaEventMouseMoved;
return true;
+ }
case WebInputEvent::MouseEnter:
np_cocoa_event->type = NPCocoaEventMouseEntered;
return true;