diff options
author | rjkroege <rjkroege@google.com> | 2015-10-09 12:15:01 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-10-09 19:15:53 +0000 |
commit | f6be0fcbcdee98de91aca7b365634595b107a209 (patch) | |
tree | 8cc00184ff758a026f691ec2c64d8a1287688384 /ui/platform_window | |
parent | 4ce1d0738599220f1beabbb700bc0c1ab1925b3f (diff) | |
download | chromium_src-f6be0fcbcdee98de91aca7b365634595b107a209.zip chromium_src-f6be0fcbcdee98de91aca7b365634595b107a209.tar.gz chromium_src-f6be0fcbcdee98de91aca7b365634595b107a209.tar.bz2 |
Correctly initialize wheel events on windows in mus
mandoline mus was not correctly initilizing the scroll offset in
ui::MouseWheelEvent instances. Fix this and re-enable the corresponding
unit test.
BUG=533588
Review URL: https://codereview.chromium.org/1392013003
Cr-Commit-Position: refs/heads/master@{#353353}
Diffstat (limited to 'ui/platform_window')
-rw-r--r-- | ui/platform_window/win/win_window.cc | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/ui/platform_window/win/win_window.cc b/ui/platform_window/win/win_window.cc index 718a409..0c63a6c 100644 --- a/ui/platform_window/win/win_window.cc +++ b/ui/platform_window/win/win_window.cc @@ -4,6 +4,7 @@ #include "ui/platform_window/win/win_window.h" +#include "base/memory/scoped_ptr.h" #include "base/strings/string16.h" #include "ui/events/event.h" #include "ui/events/event_utils.h" @@ -121,12 +122,12 @@ LRESULT WinWindow::OnMouseRange(UINT message, WPARAM w_param, LPARAM l_param) { MSG msg = { hwnd(), message, w_param, l_param, static_cast<DWORD>(GetMessageTime()), { CR_GET_X_LPARAM(l_param), CR_GET_Y_LPARAM(l_param) } }; - MouseEvent event(msg); + scoped_ptr<Event> event = EventFromNative(msg); if (IsMouseEventFromTouch(message)) - event.set_flags(event.flags() | EF_FROM_TOUCH); - if (!(event.flags() & ui::EF_IS_NON_CLIENT)) - delegate_->DispatchEvent(&event); - SetMsgHandled(event.handled()); + event->set_flags(event->flags() | EF_FROM_TOUCH); + if (!(event->flags() & ui::EF_IS_NON_CLIENT)) + delegate_->DispatchEvent(event.get()); + SetMsgHandled(event->handled()); return 0; } |