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

Unified Diff: ui/events/ozone/evdev/event_factory_evdev.cc

Issue 1260453006: ui: events: Add a class to hold common touch and stylus properties (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address build problems, add accessor and unit tests. Created 5 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: ui/events/ozone/evdev/event_factory_evdev.cc
diff --git a/ui/events/ozone/evdev/event_factory_evdev.cc b/ui/events/ozone/evdev/event_factory_evdev.cc
index 9d79b14b0483ff6eb4ab0c7342b72dd4d323d126..54666c0be0c07c336a02212dfcb7ac27ddd9bab8 100644
--- a/ui/events/ozone/evdev/event_factory_evdev.cc
+++ b/ui/events/ozone/evdev/event_factory_evdev.cc
@@ -165,7 +165,8 @@ void EventFactoryEvdev::DispatchMouseMoveEvent(
params.device_id);
MouseEvent event(ui::ET_MOUSE_MOVED, params.location, params.location,
params.timestamp, modifiers_.GetModifierFlags(),
- /* changed_button_flags */ 0);
+ /* changed_button_flags */ 0,
+ PointerEventDetails(EventPointerType::POINTER_TYPE_MOUSE));
event.set_source_device_id(params.device_id);
DispatchUiEvent(&event);
}
@@ -214,7 +215,8 @@ void EventFactoryEvdev::DispatchMouseButtonEvent(
MouseEvent event(params.down ? ui::ET_MOUSE_PRESSED : ui::ET_MOUSE_RELEASED,
params.location, params.location, params.timestamp,
modifiers_.GetModifierFlags() | flag,
- /* changed_button_flags */ flag);
+ /* changed_button_flags */ flag,
+ PointerEventDetails(EventPointerType::POINTER_TYPE_MOUSE));
event.set_source_device_id(params.device_id);
DispatchUiEvent(&event);
}
@@ -261,10 +263,12 @@ void EventFactoryEvdev::DispatchTouchEvent(const TouchEventParams& params) {
// params.slot is guaranteed to be < kNumTouchEvdevSlots.
int touch_id = touch_id_generator_.GetGeneratedID(
params.device_id * kNumTouchEvdevSlots + params.slot);
- TouchEvent touch_event(params.type, gfx::PointF(x, y),
- modifiers_.GetModifierFlags(), touch_id,
- params.timestamp, radius_x, radius_y,
- /* angle */ 0.f, params.pressure);
+ TouchEvent touch_event(
+ params.type, gfx::PointF(x, y), modifiers_.GetModifierFlags(), touch_id,
+ params.timestamp, /* angle */ 0.f,
+ PointerEventDetails(EventPointerType::POINTER_TYPE_TOUCH, radius_x,
+ radius_y, params.pressure, /* tilt_x */ 0.f,
+ /* tilt_y */ 0.f));
touch_event.set_source_device_id(params.device_id);
DispatchUiEvent(&touch_event);

Powered by Google App Engine
This is Rietveld 408576698