Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(339)

Unified Diff: content/browser/renderer_host/input/synthetic_gesture_target_aura.cc

Issue 2287403002: Create MouseWheelEvent directly instead of through MouseEvent. (Closed)
Patch Set: test Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/renderer_host/input/synthetic_gesture_target_aura.cc
diff --git a/content/browser/renderer_host/input/synthetic_gesture_target_aura.cc b/content/browser/renderer_host/input/synthetic_gesture_target_aura.cc
index 64e1c16b9f72172561d84f1da9cb712e9c378fa6..14694ea8e870e4e6df6ee97281b58709e146b25f 100644
--- a/content/browser/renderer_host/input/synthetic_gesture_target_aura.cc
+++ b/content/browser/renderer_host/input/synthetic_gesture_target_aura.cc
@@ -59,14 +59,13 @@ void SyntheticGestureTargetAura::DispatchWebTouchEventToPlatform(
void SyntheticGestureTargetAura::DispatchWebMouseWheelEventToPlatform(
const blink::WebMouseWheelEvent& web_wheel,
const ui::LatencyInfo&) {
- ui::MouseEvent mouse_event(ui::ET_MOUSEWHEEL, gfx::Point(), gfx::Point(),
- ui::EventTimeForNow(), ui::EF_NONE, ui::EF_NONE);
+ ui::MouseWheelEvent wheel_event(
+ gfx::Vector2d(web_wheel.deltaX, web_wheel.deltaY), gfx::Point(),
+ gfx::Point(), ui::EventTimeForNow(), ui::EF_NONE, ui::EF_NONE);
gfx::PointF location(web_wheel.x * device_scale_factor_,
web_wheel.y * device_scale_factor_);
- mouse_event.set_location_f(location);
- mouse_event.set_root_location_f(location);
- ui::MouseWheelEvent wheel_event(
- mouse_event, web_wheel.deltaX, web_wheel.deltaY);
+ wheel_event.set_location_f(location);
+ wheel_event.set_root_location_f(location);
aura::Window* window = GetWindow();
wheel_event.ConvertLocationToTarget(window, window->GetRootWindow());

Powered by Google App Engine
This is Rietveld 408576698