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); |