Commit 0dd74126 authored by chaopeng's avatar chaopeng Committed by Commit Bot

Fill the modifier state for scroll on Touchpad

Since touchpad gestures will expose as mousewheel events on JS.
Developer may want the modifier state. In this patch, we read the
modifier state and fill it into the event.

Bug: 779372
Change-Id: Idf3ab53433795a40c7e89c887a9bb38a0c9f5f6b
Reviewed-on: https://chromium-review.googlesource.com/996379Reviewed-by: default avatarScott Violet <sky@chromium.org>
Commit-Queue: Jianpeng Chao <chaopeng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#548824}
parent fa0473b1
......@@ -1118,15 +1118,17 @@ void HWNDMessageHandler::ApplyPanGestureEvent(
gfx::Point cursor_location(location);
gfx::Point cursor_root_location(root_location);
int modifiers = ui::GetModifiersFromKeyState();
if (IsPrecisionTouchpadNavigationGestureEnabled()) {
ui::ScrollEvent event(ui::ET_SCROLL, cursor_location, ui::EventTimeForNow(),
ui::EF_NONE, scroll_x, scroll_y, scroll_x, scroll_y,
2, momentum_phase, phase);
modifiers, scroll_x, scroll_y, scroll_x, scroll_y, 2,
momentum_phase, phase);
delegate_->HandleScrollEvent(&event);
} else {
ui::MouseWheelEvent wheel_event(
offset, cursor_location, cursor_root_location, base::TimeTicks::Now(),
ui::EF_PRECISION_SCROLLING_DELTA, ui::EF_NONE);
modifiers | ui::EF_PRECISION_SCROLLING_DELTA, ui::EF_NONE);
delegate_->HandleMouseEvent(&wheel_event);
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment