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

Unified Diff: ui/events/event.cc

Issue 2786693002: Add PointerDetails to ui::MouseEvent's constructors (Closed)
Patch Set: mouse event constructor Created 3 years, 9 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 64f06d0cae3d0fbef8a52b7a4c723663beca8582..0fef5698a328c4c8f5a1e47819f43fd5f15a3303 100644
--- a/ui/events/event.cc
+++ b/ui/events/event.cc
@@ -625,14 +625,15 @@ MouseEvent::MouseEvent(EventType type,
const gfx::Point& root_location,
base::TimeTicks time_stamp,
int flags,
- int changed_button_flags)
+ int changed_button_flags,
+ const PointerDetails& pointer_details)
: LocatedEvent(type,
gfx::PointF(location),
gfx::PointF(root_location),
time_stamp,
flags),
changed_button_flags_(changed_button_flags),
- pointer_details_(PointerDetails(EventPointerType::POINTER_TYPE_MOUSE)) {
+ pointer_details_(pointer_details) {
DCHECK_NE(ET_MOUSEWHEEL, type);
latency()->AddLatencyNumber(INPUT_EVENT_LATENCY_UI_COMPONENT, 0, 0);
if (this->type() == ET_MOUSE_MOVED && IsAnyButton())
@@ -812,7 +813,9 @@ MouseWheelEvent::MouseWheelEvent(const gfx::Vector2d& offset,
root_location,
time_stamp,
flags,
- changed_button_flags),
+ changed_button_flags,
+ PointerDetails(ui::EventPointerType::POINTER_TYPE_MOUSE,
+ PointerEvent::kMousePointerId)),
offset_(offset) {
// Set event type to ET_UNKNOWN initially in MouseEvent() to pass the
// DCHECK for type to enforce that we use MouseWheelEvent() to create
@@ -1411,7 +1414,14 @@ ScrollEvent::ScrollEvent(EventType type,
float y_offset_ordinal,
int finger_count,
EventMomentumPhase momentum_phase)
- : MouseEvent(type, location, location, time_stamp, flags, 0),
+ : MouseEvent(type,
+ location,
+ location,
+ time_stamp,
+ flags,
+ 0,
+ PointerDetails(ui::EventPointerType::POINTER_TYPE_MOUSE,
+ PointerEvent::kMousePointerId)),
x_offset_(x_offset),
y_offset_(y_offset),
x_offset_ordinal_(x_offset_ordinal),

Powered by Google App Engine
This is Rietveld 408576698