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

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

Issue 2861373004: Add blink::WebInputEvent::IsPinchGestureEventType(). (Closed)
Patch Set: rebase 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 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 ce3730058b06cdc18835cbe5368fbc4d26216ed8..362d189be0b596725767eeb0c8ac8df94f09a076 100644
--- a/third_party/WebKit/public/platform/WebInputEvent.h
+++ b/third_party/WebKit/public/platform/WebInputEvent.h
@@ -130,8 +130,10 @@ class WebInputEvent {
kGestureFlingCancel,
// Pinch is two fingers moving closer or farther apart.
kGesturePinchBegin,
+ kGesturePinchTypeFirst = kGesturePinchBegin,
kGesturePinchEnd,
kGesturePinchUpdate,
+ kGesturePinchTypeLast = kGesturePinchUpdate,
// The following types are variations and subevents of single-taps.
//
@@ -279,22 +281,22 @@ class WebInputEvent {
static constexpr double kTimeStampForTesting = 123.0;
// Returns true if the WebInputEvent |type| is a mouse event.
- static bool IsMouseEventType(int type) {
+ static bool IsMouseEventType(WebInputEvent::Type type) {
return kMouseTypeFirst <= type && type <= kMouseTypeLast;
}
// Returns true if the WebInputEvent |type| is a keyboard event.
- static bool IsKeyboardEventType(int type) {
+ static bool IsKeyboardEventType(WebInputEvent::Type type) {
return kKeyboardTypeFirst <= type && type <= kKeyboardTypeLast;
}
// Returns true if the WebInputEvent |type| is a touch event.
- static bool IsTouchEventType(int type) {
+ static bool IsTouchEventType(WebInputEvent::Type type) {
return kTouchTypeFirst <= type && type <= kTouchTypeLast;
}
// Returns true if the WebInputEvent is a gesture event.
- static bool IsGestureEventType(int type) {
+ static bool IsGestureEventType(WebInputEvent::Type type) {
return kGestureTypeFirst <= type && type <= kGestureTypeLast;
}
@@ -310,6 +312,11 @@ class WebInputEvent {
return type_ == other.type_;
}
+ // Returns true if the WebInputEvent |type| is a pinch gesture event.
+ static bool IsPinchGestureEventType(WebInputEvent::Type type) {
+ return kGesturePinchTypeFirst <= type && type <= kGesturePinchTypeLast;
+ }
+
static const char* GetName(WebInputEvent::Type type) {
#define CASE_TYPE(t) \
case WebInputEvent::k##t: \
@@ -402,7 +409,7 @@ class WebInputEvent {
#endif
}
- WebInputEvent(unsigned size_param) {
+ explicit WebInputEvent(unsigned size_param) {
// TODO(dtapuska): Remove this memset when we remove the chrome IPC of this
// struct.
memset(this, 0, size_param);
« no previous file with comments | « third_party/WebKit/Source/web/DevToolsEmulator.cpp ('k') | ui/web_dialogs/web_dialog_web_contents_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698