diff options
| author | sadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-15 21:39:45 +0000 |
|---|---|---|
| committer | sadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-15 21:39:45 +0000 |
| commit | 824fa240a951a80fb8cde109d09e912f2af56f79 (patch) | |
| tree | c04e51c977d1dd6401fe65d211b6c55a48619768 | |
| parent | a7141f4639e66abf6a0ab0f4712f23a7e7778378 (diff) | |
| download | chromium_src-824fa240a951a80fb8cde109d09e912f2af56f79.zip chromium_src-824fa240a951a80fb8cde109d09e912f2af56f79.tar.gz chromium_src-824fa240a951a80fb8cde109d09e912f2af56f79.tar.bz2 | |
ppapi: Set the mouse_button correctly for mouse-move events.
This fixes sending drag-events (i.e. press + move events need to have
|mouse_button| set).
BUG=none
TEST=manually
Review URL: https://chromiumcodereview.appspot.com/10532137
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@142485 0039d316-1c4b-4281-b951-d872f2087c98
| -rw-r--r-- | webkit/plugins/ppapi/event_conversion.cc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/webkit/plugins/ppapi/event_conversion.cc b/webkit/plugins/ppapi/event_conversion.cc index fa50d8f..22f1b42a8 100644 --- a/webkit/plugins/ppapi/event_conversion.cc +++ b/webkit/plugins/ppapi/event_conversion.cc @@ -270,6 +270,14 @@ WebMouseEvent* BuildMouseEvent(const InputEventData& event) { mouse_event->modifiers = event.event_modifiers; mouse_event->button = static_cast<WebMouseEvent::Button>(event.mouse_button); + if (mouse_event->type == WebInputEvent::MouseMove) { + if (mouse_event->modifiers & WebInputEvent::LeftButtonDown) + mouse_event->button = WebMouseEvent::ButtonLeft; + else if (mouse_event->modifiers & WebInputEvent::MiddleButtonDown) + mouse_event->button = WebMouseEvent::ButtonMiddle; + else if (mouse_event->modifiers & WebInputEvent::RightButtonDown) + mouse_event->button = WebMouseEvent::ButtonRight; + } mouse_event->x = event.mouse_position.x; mouse_event->y = event.mouse_position.y; mouse_event->clickCount = event.mouse_click_count; |
