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

Unified Diff: third_party/WebKit/public/platform/WebInputEvent.h

Issue 2860663006: Remove WebTouchEvent from TouchEventManager APIs (Closed)
Patch Set: Add TODO for clarification of the fields Created 3 years, 6 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: third_party/WebKit/public/platform/WebInputEvent.h
diff --git a/third_party/WebKit/public/platform/WebInputEvent.h b/third_party/WebKit/public/platform/WebInputEvent.h
index 362d189be0b596725767eeb0c8ac8df94f09a076..3ebd465c0871cfb85a8d88ba4afc09346de92eee 100644
--- a/third_party/WebKit/public/platform/WebInputEvent.h
+++ b/third_party/WebKit/public/platform/WebInputEvent.h
@@ -180,6 +180,14 @@ class WebInputEvent {
kTouchScrollStarted,
kTouchTypeLast = kTouchScrollStarted,
+ // WebPointerEvent: work in progress
+ kPointerDown,
+ kPointerTypeFirst = kPointerDown,
+ kPointerUp,
+ kPointerMove,
+ kPointerCancel,
+ kPointerTypeLast = kPointerCancel,
+
kTypeLast = kTouchTypeLast
};
@@ -300,6 +308,11 @@ class WebInputEvent {
return kGestureTypeFirst <= type && type <= kGestureTypeLast;
}
+ // Returns true if the WebInputEvent |type| is a pointer event.
+ static bool IsPointerEventType(WebInputEvent::Type type) {
+ return kPointerTypeFirst <= type && type <= kPointerTypeLast;
+ }
+
bool IsSameEventClass(const WebInputEvent& other) const {
if (IsMouseEventType(type_))
return IsMouseEventType(other.type_);
@@ -309,6 +322,8 @@ class WebInputEvent {
return IsTouchEventType(other.type_);
if (IsKeyboardEventType(type_))
return IsKeyboardEventType(other.type_);
+ if (IsPointerEventType(type_))
+ return IsPointerEventType(other.type_);
return type_ == other.type_;
}
@@ -356,11 +371,14 @@ class WebInputEvent {
CASE_TYPE(TouchEnd);
CASE_TYPE(TouchCancel);
CASE_TYPE(TouchScrollStarted);
- default:
- NOTREACHED();
- return "";
+ CASE_TYPE(PointerDown);
+ CASE_TYPE(PointerUp);
+ CASE_TYPE(PointerMove);
+ CASE_TYPE(PointerCancel);
}
#undef CASE_TYPE
+ NOTREACHED();
+ return "";
}
float FrameScale() const { return frame_scale_; }

Powered by Google App Engine
This is Rietveld 408576698