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

Unified Diff: ui/events/event.h

Issue 2849083002: Add pointer id to the WebMouseEvent's constructors (Closed)
Patch Set: webmouseid Created 3 years, 7 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
« no previous file with comments | « ui/events/blink/web_input_event_builders_win.cc ('k') | ui/events/event.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/event.h
diff --git a/ui/events/event.h b/ui/events/event.h
index 5a8b2defc5851396fdcd74008351b6c52b313bee..2a2e0c1c9335f65d701943f7a72a6c3cab1ace8d 100644
--- a/ui/events/event.h
+++ b/ui/events/event.h
@@ -47,6 +47,7 @@ class Event;
class MouseWheelEvent;
using ScopedEvent = std::unique_ptr<Event>;
+using PointerId = int32_t;
class EVENTS_EXPORT Event {
public:
@@ -412,9 +413,9 @@ struct EVENTS_EXPORT PointerDetails {
public:
PointerDetails();
explicit PointerDetails(EventPointerType pointer_type,
- int pointer_id = kUnknownPointerId);
+ PointerId pointer_id = kUnknownPointerId);
PointerDetails(EventPointerType pointer_type,
- int pointer_id,
+ PointerId pointer_id,
float radius_x,
float radius_y,
float force,
@@ -424,7 +425,7 @@ struct EVENTS_EXPORT PointerDetails {
int twist = 0);
PointerDetails(EventPointerType pointer_type,
const gfx::Vector2d& pointer_offset,
- int pointer_id = kUnknownPointerId);
+ PointerId pointer_id = kUnknownPointerId);
PointerDetails(const PointerDetails& other);
bool operator==(const PointerDetails& other) const {
@@ -439,7 +440,7 @@ struct EVENTS_EXPORT PointerDetails {
// A value for pointer id which means it needs to be initialized for all
// pointer types.
- static const int kUnknownPointerId;
+ static const PointerId kUnknownPointerId;
// The type of pointer device.
EventPointerType pointer_type = EventPointerType::POINTER_TYPE_UNKNOWN;
@@ -471,7 +472,7 @@ struct EVENTS_EXPORT PointerDetails {
int twist = 0;
// An identifier that uniquely identifies a pointer during its lifetime.
- int id = 0;
+ PointerId id = 0;
// Only used by mouse wheel events. The amount to scroll. This is in multiples
// of kWheelDelta.
@@ -481,7 +482,7 @@ struct EVENTS_EXPORT PointerDetails {
class EVENTS_EXPORT MouseEvent : public LocatedEvent {
public:
- static const int32_t kMousePointerId;
+ static const PointerId kMousePointerId;
explicit MouseEvent(const base::NativeEvent& native_event);
« no previous file with comments | « ui/events/blink/web_input_event_builders_win.cc ('k') | ui/events/event.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698