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

Unified Diff: ui/events/event.h

Issue 1728603002: Fix ui::Event::Clone() for ui::PointerEvent. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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 | « no previous file | 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 90ea9d98e03f5657a946bd5a386b9aa69dc461ee..6c0fbcc96d19ae38a2a07a7f11d764cf8bae9fdd 100644
--- a/ui/events/event.h
+++ b/ui/events/event.h
@@ -29,6 +29,7 @@ class Transform;
namespace ui {
class EventTarget;
+class PointerEvent;
enum class DomCode;
class EVENTS_EXPORT Event {
@@ -198,7 +199,7 @@ class EVENTS_EXPORT Event {
bool IsLocatedEvent() const {
return IsMouseEvent() || IsScrollEvent() || IsTouchEvent() ||
- IsGestureEvent();
+ IsGestureEvent() || IsPointerEvent();
}
// Convenience methods to cast |this| to a GestureEvent. IsGestureEvent()
@@ -206,6 +207,11 @@ class EVENTS_EXPORT Event {
GestureEvent* AsGestureEvent();
const GestureEvent* AsGestureEvent() const;
+ // Convenience methods to cast |this| to a PointerEvent. IsPointerEvent()
+ // must be true as a precondition to calling these methods.
+ PointerEvent* AsPointerEvent();
+ const PointerEvent* AsPointerEvent() const;
+
// Returns true if the event has a valid |native_event_|.
bool HasNativeEvent() const;
@@ -648,6 +654,7 @@ class EVENTS_EXPORT PointerEvent : public LocatedEvent {
public:
static const int32_t kMousePointerId;
+ explicit PointerEvent(const PointerEvent& pointer_event);
explicit PointerEvent(const MouseEvent& mouse_event);
explicit PointerEvent(const TouchEvent& touch_event);
« no previous file with comments | « no previous file | ui/events/event.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698