summaryrefslogtreecommitdiffstats
path: root/views
diff options
context:
space:
mode:
authormsw@chromium.org <msw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-29 01:08:50 +0000
committermsw@chromium.org <msw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-29 01:08:50 +0000
commit13dc50a28ade9c249f0a38b5a9033daa959f68a3 (patch)
tree68a72bf0777441d9c7870862e0f0086fa00c1086 /views
parentd10b4d3a3c4407ecd78e7415cfa70d9ad84141da (diff)
downloadchromium_src-13dc50a28ade9c249f0a38b5a9033daa959f68a3.zip
chromium_src-13dc50a28ade9c249f0a38b5a9033daa959f68a3.tar.gz
chromium_src-13dc50a28ade9c249f0a38b5a9033daa959f68a3.tar.bz2
Parse Windows mouse drag events.
BUG=72040 TEST=Mouse moving & dragging on Windows. Review URL: http://codereview.chromium.org/6883241 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@83465 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views')
-rw-r--r--views/events/event_win.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/views/events/event_win.cc b/views/events/event_win.cc
index 2fb691e..06c892c 100644
--- a/views/events/event_win.cc
+++ b/views/events/event_win.cc
@@ -24,6 +24,11 @@ int GetKeyStateFlags() {
return flags;
}
+bool IsButtonDown(NativeEvent native_event) {
+ return (native_event.wParam & (MK_LBUTTON | MK_MBUTTON | MK_RBUTTON |
+ MK_XBUTTON1 | MK_XBUTTON2)) != 0;
+}
+
// Convert windows message identifiers to Event types.
ui::EventType EventTypeFromNative(NativeEvent native_event) {
switch (native_event.message) {
@@ -56,7 +61,8 @@ ui::EventType EventTypeFromNative(NativeEvent native_event) {
return ui::ET_MOUSE_RELEASED;
case WM_MOUSEMOVE:
case WM_NCMOUSEMOVE:
- return ui::ET_MOUSE_MOVED;
+ return IsButtonDown(native_event) ? ui::ET_MOUSE_DRAGGED :
+ ui::ET_MOUSE_MOVED;
case WM_MOUSEWHEEL:
return ui::ET_MOUSEWHEEL;
case WM_MOUSELEAVE: