summaryrefslogtreecommitdiffstats
path: root/views/events
diff options
context:
space:
mode:
authorjianli@chromium.org <jianli@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-28 21:51:36 +0000
committerjianli@chromium.org <jianli@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-28 21:51:36 +0000
commitfe42b8c6c70c9d72bc0b2c0097c456ce5edffab0 (patch)
tree970911533783989edff0986563c19bdb30a326e9 /views/events
parenta78286f3fe316afebdb55a6c107915c5ff464fbe (diff)
downloadchromium_src-fe42b8c6c70c9d72bc0b2c0097c456ce5edffab0.zip
chromium_src-fe42b8c6c70c9d72bc0b2c0097c456ce5edffab0.tar.gz
chromium_src-fe42b8c6c70c9d72bc0b2c0097c456ce5edffab0.tar.bz2
Support creating panel on windows. Also allow dragging panels to rearrange
positions. BUG=none TEST=Basic test in panel_browsertest Review URL: http://codereview.chromium.org/6897012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@83415 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/events')
-rw-r--r--views/events/event_win.cc33
1 files changed, 26 insertions, 7 deletions
diff --git a/views/events/event_win.cc b/views/events/event_win.cc
index cd1d715..2fb691e 100644
--- a/views/events/event_win.cc
+++ b/views/events/event_win.cc
@@ -134,13 +134,32 @@ int EventFlagsFromNative(NativeEvent native_event) {
break;
}
- UINT win_flags = GET_KEYSTATE_WPARAM(native_event.wParam);
- flags |= (win_flags & MK_CONTROL) ? ui::EF_CONTROL_DOWN : 0;
- flags |= (win_flags & MK_SHIFT) ? ui::EF_SHIFT_DOWN : 0;
- flags |= (GetKeyState(VK_MENU) < 0) ? ui::EF_ALT_DOWN : 0;
- flags |= (win_flags & MK_LBUTTON) ? ui::EF_LEFT_BUTTON_DOWN : 0;
- flags |= (win_flags & MK_MBUTTON) ? ui::EF_MIDDLE_BUTTON_DOWN : 0;
- flags |= (win_flags & MK_RBUTTON) ? ui::EF_RIGHT_BUTTON_DOWN : 0;
+ // For non-client mouse message, the WPARAM value represents the hit test
+ // result, instead of the key state.
+ switch (native_event.message) {
+ case WM_NCLBUTTONDOWN:
+ case WM_NCLBUTTONUP:
+ flags |= ui::EF_LEFT_BUTTON_DOWN;
+ break;
+ case WM_NCMBUTTONDOWN:
+ case WM_NCMBUTTONUP:
+ flags |= ui::EF_MIDDLE_BUTTON_DOWN;
+ break;
+ case WM_NCRBUTTONDOWN:
+ case WM_NCRBUTTONUP:
+ flags |= ui::EF_RIGHT_BUTTON_DOWN;
+ break;
+ default: {
+ UINT win_flags = GET_KEYSTATE_WPARAM(native_event.wParam);
+ flags |= (win_flags & MK_CONTROL) ? ui::EF_CONTROL_DOWN : 0;
+ flags |= (win_flags & MK_SHIFT) ? ui::EF_SHIFT_DOWN : 0;
+ flags |= (GetKeyState(VK_MENU) < 0) ? ui::EF_ALT_DOWN : 0;
+ flags |= (win_flags & MK_LBUTTON) ? ui::EF_LEFT_BUTTON_DOWN : 0;
+ flags |= (win_flags & MK_MBUTTON) ? ui::EF_MIDDLE_BUTTON_DOWN : 0;
+ flags |= (win_flags & MK_RBUTTON) ? ui::EF_RIGHT_BUTTON_DOWN : 0;
+ break;
+ }
+ }
return flags;
}