Index: ui/events/event.h |
diff --git a/ui/events/event.h b/ui/events/event.h |
index d07fc639222a4b78e672b850b5bf38d452603308..8671b643abc77ff9e40fee01c4cb0723ff7ed44f 100644 |
--- a/ui/events/event.h |
+++ b/ui/events/event.h |
@@ -408,10 +408,8 @@ class EVENTS_EXPORT LocatedEvent : public Event { |
// PointerEvents API. |
struct EVENTS_EXPORT PointerDetails { |
public: |
- PointerDetails() {} |
- explicit PointerDetails(EventPointerType pointer_type) |
- : pointer_type(pointer_type), |
- force(std::numeric_limits<float>::quiet_NaN()) {} |
+ PointerDetails(); |
+ explicit PointerDetails(EventPointerType pointer_type); |
PointerDetails(EventPointerType pointer_type, |
float radius_x, |
float radius_y, |
@@ -419,21 +417,10 @@ struct EVENTS_EXPORT PointerDetails { |
float tilt_x, |
float tilt_y, |
float tangential_pressure = 0.0f, |
- int twist = 0) |
- : 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) {} |
- PointerDetails(EventPointerType pointer_type, const gfx::Vector2d& offset) |
- : pointer_type(pointer_type), |
- force(std::numeric_limits<float>::quiet_NaN()), |
- offset(offset) {} |
+ int twist = 0, |
+ uint32_t id = 0); |
+ PointerDetails(EventPointerType pointer_type, const gfx::Vector2d& offset); |
+ PointerDetails(const PointerDetails& other); |
bool operator==(const PointerDetails& other) const { |
return pointer_type == other.pointer_type && radius_x == other.radius_x && |
@@ -442,7 +429,7 @@ struct EVENTS_EXPORT PointerDetails { |
(std::isnan(force) && std::isnan(other.force))) && |
tilt_x == other.tilt_x && tilt_y == other.tilt_y && |
tangential_pressure == other.tangential_pressure && |
- twist == other.twist && offset == other.offset; |
+ twist == other.twist && id == other.id && offset == other.offset; |
} |
// The type of pointer device. |
@@ -474,6 +461,9 @@ struct EVENTS_EXPORT PointerDetails { |
// degrees in the range [0,359]. Always 0 if the device does not support it. |
int twist = 0; |
+ // An identifier that uniquely identifies a pointer during its lifetime. |
+ uint32_t id = 0; |
mustaq
2017/01/31 00:24:13
Where do we set the id from lower level events? Do
|
+ |
sadrul
2017/01/31 17:05:13
ui::TouchEvent has a touch_id(), and a unique_even
lanwei
2017/02/01 02:58:12
This id in PointerDetails makes more senses for st
sadrul
2017/02/01 20:59:39
Replacing TouchEvent::touch_id() (and I guess Poin
|
// Only used by mouse wheel events. The amount to scroll. This is in multiples |
// of kWheelDelta. |
// Note: offset_.x() > 0/offset_.y() > 0 means scroll left/up. |