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

Unified Diff: ui/events/event.cc

Issue 2655303004: Add id properties to PointerEvent (Closed)
Patch Set: change id type to uint32_t Created 3 years, 11 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/event.cc
diff --git a/ui/events/event.cc b/ui/events/event.cc
index 879f3e1e96647fb0447e0012c00bbef6195d0401..5d0589f1ef00b9c1488a68eef29718449b681d67 100644
--- a/ui/events/event.cc
+++ b/ui/events/event.cc
@@ -501,6 +501,44 @@ void LocatedEvent::UpdateForRootTransform(
}
////////////////////////////////////////////////////////////////////////////////
+// PointerDetails
+
+PointerDetails::PointerDetails() {}
+
+PointerDetails::PointerDetails(EventPointerType pointer_type)
+ : pointer_type(pointer_type),
+ force(std::numeric_limits<float>::quiet_NaN()) {}
+
+PointerDetails::PointerDetails(EventPointerType pointer_type,
+ float radius_x,
+ float radius_y,
+ float force,
+ float tilt_x,
+ float tilt_y,
+ float tangential_pressure,
+ int twist,
+ uint32_t id)
+ : pointer_type(pointer_type),
+ // If we aren't provided with a radius on one axis, use the
+ // information from the other axis.
+ radius_x(radius_x > 0 ? radius_x : radius_y),
+ radius_y(radius_y > 0 ? radius_y : radius_x),
+ force(force),
+ tilt_x(tilt_x),
+ tilt_y(tilt_y),
+ tangential_pressure(tangential_pressure),
+ twist(twist),
+ id(id) {}
+
+PointerDetails::PointerDetails(EventPointerType pointer_type,
+ const gfx::Vector2d& offset)
+ : pointer_type(pointer_type),
+ force(std::numeric_limits<float>::quiet_NaN()),
+ offset(offset) {}
+
+PointerDetails::PointerDetails(const PointerDetails& other) = default;
+
+////////////////////////////////////////////////////////////////////////////////
// MouseEvent
MouseEvent::MouseEvent(const base::NativeEvent& native_event)
« ui/events/event.h ('K') | « ui/events/event.h ('k') | ui/events/event_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698