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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef UI_EVENTS_EVENT_H_ 5 #ifndef UI_EVENTS_EVENT_H_
6 #define UI_EVENTS_EVENT_H_ 6 #define UI_EVENTS_EVENT_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after
474 int id = 0; 474 int id = 0;
475 475
476 // Only used by mouse wheel events. The amount to scroll. This is in multiples 476 // Only used by mouse wheel events. The amount to scroll. This is in multiples
477 // of kWheelDelta. 477 // of kWheelDelta.
478 // Note: offset_.x() > 0/offset_.y() > 0 means scroll left/up. 478 // Note: offset_.x() > 0/offset_.y() > 0 means scroll left/up.
479 gfx::Vector2d offset; 479 gfx::Vector2d offset;
480 }; 480 };
481 481
482 class EVENTS_EXPORT MouseEvent : public LocatedEvent { 482 class EVENTS_EXPORT MouseEvent : public LocatedEvent {
483 public: 483 public:
484 static const int32_t kMousePointerId; 484 static const int kDefaultMousePointerId;
sky 2017/05/04 15:26:01 Could you clarify why you are changing this? Isn't
485 485
486 explicit MouseEvent(const base::NativeEvent& native_event); 486 explicit MouseEvent(const base::NativeEvent& native_event);
487 487
488 // |pointer_event.IsMousePointerEvent()| must be true. 488 // |pointer_event.IsMousePointerEvent()| must be true.
489 // Note: If |pointer_event| is a mouse wheel pointer event, use the 489 // Note: If |pointer_event| is a mouse wheel pointer event, use the
490 // MouseWheelEvent version of this function to convert to a MouseWheelEvent 490 // MouseWheelEvent version of this function to convert to a MouseWheelEvent
491 // instead. 491 // instead.
492 explicit MouseEvent(const PointerEvent& pointer_event); 492 explicit MouseEvent(const PointerEvent& pointer_event);
493 493
494 // Create a new MouseEvent based on the provided model. 494 // Create a new MouseEvent based on the provided model.
(...skipping 22 matching lines...) Expand all
517 // Used for synthetic events in testing, gesture recognizer and Ozone 517 // Used for synthetic events in testing, gesture recognizer and Ozone
518 // Note: Use the ctor for MouseWheelEvent if type is ET_MOUSEWHEEL. 518 // Note: Use the ctor for MouseWheelEvent if type is ET_MOUSEWHEEL.
519 MouseEvent(EventType type, 519 MouseEvent(EventType type,
520 const gfx::Point& location, 520 const gfx::Point& location,
521 const gfx::Point& root_location, 521 const gfx::Point& root_location,
522 base::TimeTicks time_stamp, 522 base::TimeTicks time_stamp,
523 int flags, 523 int flags,
524 int changed_button_flags, 524 int changed_button_flags,
525 const PointerDetails& pointer_details = 525 const PointerDetails& pointer_details =
526 PointerDetails(EventPointerType::POINTER_TYPE_MOUSE, 526 PointerDetails(EventPointerType::POINTER_TYPE_MOUSE,
527 kMousePointerId)); 527 kDefaultMousePointerId));
528 528
529 // Conveniences to quickly test what button is down 529 // Conveniences to quickly test what button is down
530 bool IsOnlyLeftMouseButton() const { 530 bool IsOnlyLeftMouseButton() const {
531 return button_flags() == EF_LEFT_MOUSE_BUTTON; 531 return button_flags() == EF_LEFT_MOUSE_BUTTON;
532 } 532 }
533 533
534 bool IsLeftMouseButton() const { 534 bool IsLeftMouseButton() const {
535 return (flags() & EF_LEFT_MOUSE_BUTTON) != 0; 535 return (flags() & EF_LEFT_MOUSE_BUTTON) != 0;
536 } 536 }
537 537
(...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after
1053 // dispatched. This field gets a non-zero value only for gestures that are 1053 // dispatched. This field gets a non-zero value only for gestures that are
1054 // released through TouchDispositionGestureFilter::SendGesture. The gesture 1054 // released through TouchDispositionGestureFilter::SendGesture. The gesture
1055 // events that aren't fired directly in response to processing a touch-event 1055 // events that aren't fired directly in response to processing a touch-event
1056 // (e.g. timer fired ones), this id is zero. See crbug.com/618738. 1056 // (e.g. timer fired ones), this id is zero. See crbug.com/618738.
1057 uint32_t unique_touch_event_id_; 1057 uint32_t unique_touch_event_id_;
1058 }; 1058 };
1059 1059
1060 } // namespace ui 1060 } // namespace ui
1061 1061
1062 #endif // UI_EVENTS_EVENT_H_ 1062 #endif // UI_EVENTS_EVENT_H_
OLDNEW
« 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