Chromium Code Reviews| 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 c7ccbf8fb7817a7aed86b220ef3841ddd5f655cd..b5950a36abb67aa4109e5ec0bffe2d5c3df2e7b6 100644 |
| --- a/third_party/WebKit/public/platform/WebInputEvent.h |
| +++ b/third_party/WebKit/public/platform/WebInputEvent.h |
| @@ -259,6 +259,51 @@ public: |
| return type == other.type; |
| } |
| +#define CASE_TYPE(t) case WebInputEvent::t: return #t |
| + static const char* GetName(WebInputEvent::Type type) |
|
dtapuska
2016/08/16 21:02:40
Can you move this implementation into the cpp file
sahel
2016/08/17 22:08:16
Done.
|
| + { |
| + switch (type) { |
| + CASE_TYPE(Undefined); |
| + CASE_TYPE(MouseDown); |
| + CASE_TYPE(MouseUp); |
| + CASE_TYPE(MouseMove); |
| + CASE_TYPE(MouseEnter); |
| + CASE_TYPE(MouseLeave); |
| + CASE_TYPE(ContextMenu); |
| + CASE_TYPE(MouseWheel); |
| + CASE_TYPE(RawKeyDown); |
| + CASE_TYPE(KeyDown); |
| + CASE_TYPE(KeyUp); |
| + CASE_TYPE(Char); |
| + CASE_TYPE(GestureScrollBegin); |
| + CASE_TYPE(GestureScrollEnd); |
| + CASE_TYPE(GestureScrollUpdate); |
| + CASE_TYPE(GestureFlingStart); |
| + CASE_TYPE(GestureFlingCancel); |
| + CASE_TYPE(GestureShowPress); |
| + CASE_TYPE(GestureTap); |
| + CASE_TYPE(GestureTapUnconfirmed); |
| + CASE_TYPE(GestureTapDown); |
| + CASE_TYPE(GestureTapCancel); |
| + CASE_TYPE(GestureDoubleTap); |
| + CASE_TYPE(GestureTwoFingerTap); |
| + CASE_TYPE(GestureLongPress); |
| + CASE_TYPE(GestureLongTap); |
| + CASE_TYPE(GesturePinchBegin); |
| + CASE_TYPE(GesturePinchEnd); |
| + CASE_TYPE(GesturePinchUpdate); |
| + CASE_TYPE(TouchStart); |
| + CASE_TYPE(TouchMove); |
| + CASE_TYPE(TouchEnd); |
| + CASE_TYPE(TouchCancel); |
| + CASE_TYPE(TouchScrollStarted); |
| + default: |
| + NOTREACHED(); |
| + return ""; |
| + } |
| + } |
| +#undef CASE_TYPE |
| + |
| protected: |
| explicit WebInputEvent(unsigned sizeParam) |
| { |