diff options
author | cpu@chromium.org <cpu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-05 21:22:12 +0000 |
---|---|---|
committer | cpu@chromium.org <cpu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-05 21:22:12 +0000 |
commit | 884cef8f1a6f00d95f686e5cdba9b147ab4aa8a9 (patch) | |
tree | d875a3c455224c8569cd642926792cb4504d40d7 /ui/aura/remote_root_window_host_win.cc | |
parent | e99cd4dca809897000378a6a4c567ab7aa8dce2b (diff) | |
download | chromium_src-884cef8f1a6f00d95f686e5cdba9b147ab4aa8a9.zip chromium_src-884cef8f1a6f00d95f686e5cdba9b147ab4aa8a9.tar.gz chromium_src-884cef8f1a6f00d95f686e5cdba9b147ab4aa8a9.tar.bz2 |
Better mouse support for metro aura
-Wheel, r-click and l-click now discriminated
-More efficient, clean mouse event handling
Note; wheel event not properly handled. That is a bigger CL
that will come later.
BUG=151718
TEST= right click and left click
Review URL: https://codereview.chromium.org/11312025
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@166034 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/aura/remote_root_window_host_win.cc')
-rw-r--r-- | ui/aura/remote_root_window_host_win.cc | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/ui/aura/remote_root_window_host_win.cc b/ui/aura/remote_root_window_host_win.cc index 63b55433..918ac4d 100644 --- a/ui/aura/remote_root_window_host_win.cc +++ b/ui/aura/remote_root_window_host_win.cc @@ -17,6 +17,9 @@ #include "ui/base/keycodes/keyboard_code_conversion_win.h" #include "ui/base/view_prop.h" +// From metro_viewer_messages.h we only care for the enums. +#include "ui/metro_viewer/metro_viewer_messages.h" + using std::max; using std::min; @@ -141,7 +144,6 @@ void RemoteRootWindowHostWin::OnDeviceScaleFactorChanged( } void RemoteRootWindowHostWin::PrepareForShutdown() { - NOTIMPLEMENTED(); } void RemoteRootWindowHostWin::OnMouseMoved(int32 x, int32 y, int32 extra) { @@ -150,14 +152,19 @@ void RemoteRootWindowHostWin::OnMouseMoved(int32 x, int32 y, int32 extra) { delegate_->OnHostMouseEvent(&event); } -void RemoteRootWindowHostWin::OnMouseClick(int32 x, int32 y, int32 extra) { +void RemoteRootWindowHostWin::OnMouseButton( + int32 x, int32 y, int32 extra, ui::EventType type, ui::EventFlags flags) { gfx::Point location(x, y); - ui::EventType type = (extra == 1) ? - ui::ET_MOUSE_PRESSED : ui::ET_MOUSE_RELEASED; - ui::MouseEvent event(type, location, location, 0); - event.SetClickCount(1); - event.set_flags(ui::EF_LEFT_MOUSE_BUTTON); - delegate_->OnHostMouseEvent(&event); + ui::MouseEvent mouse_event(type, location, location, 0); + mouse_event.set_flags(flags); + + if (type == ui::ET_MOUSEWHEEL) { + ui::MouseWheelEvent wheel_event(mouse_event, extra); + delegate_->OnHostMouseEvent(&wheel_event); + } else { + mouse_event.SetClickCount(1); + delegate_->OnHostMouseEvent(&mouse_event); + } } void RemoteRootWindowHostWin::OnKeyDown(uint32 vkey, |