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

Side by Side Diff: third_party/WebKit/Source/web/WebInputEvent.cpp

Issue 2250233002: Type->String helper function added to WebInputEvent. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Blink_Common_export instead of blink_export Created 4 years, 3 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 int touchData[4]; 63 int touchData[4];
64 }; 64 };
65 65
66 static_assert(sizeof(WebInputEvent) == sizeof(SameSizeAsWebInputEvent), "WebInpu tEvent should not have gaps"); 66 static_assert(sizeof(WebInputEvent) == sizeof(SameSizeAsWebInputEvent), "WebInpu tEvent should not have gaps");
67 static_assert(sizeof(WebKeyboardEvent) == sizeof(SameSizeAsWebKeyboardEvent), "W ebKeyboardEvent should not have gaps"); 67 static_assert(sizeof(WebKeyboardEvent) == sizeof(SameSizeAsWebKeyboardEvent), "W ebKeyboardEvent should not have gaps");
68 static_assert(sizeof(WebMouseEvent) == sizeof(SameSizeAsWebMouseEvent), "WebMous eEvent should not have gaps"); 68 static_assert(sizeof(WebMouseEvent) == sizeof(SameSizeAsWebMouseEvent), "WebMous eEvent should not have gaps");
69 static_assert(sizeof(WebMouseWheelEvent) == sizeof(SameSizeAsWebMouseWheelEvent) , "WebMouseWheelEvent should not have gaps"); 69 static_assert(sizeof(WebMouseWheelEvent) == sizeof(SameSizeAsWebMouseWheelEvent) , "WebMouseWheelEvent should not have gaps");
70 static_assert(sizeof(WebGestureEvent) == sizeof(SameSizeAsWebGestureEvent), "Web GestureEvent should not have gaps"); 70 static_assert(sizeof(WebGestureEvent) == sizeof(SameSizeAsWebGestureEvent), "Web GestureEvent should not have gaps");
71 static_assert(sizeof(WebTouchEvent) == sizeof(SameSizeAsWebTouchEvent), "WebTouc hEvent should not have gaps"); 71 static_assert(sizeof(WebTouchEvent) == sizeof(SameSizeAsWebTouchEvent), "WebTouc hEvent should not have gaps");
72 72
73 #define CASE_TYPE(t) case WebInputEvent::t: return #t
74 // static
75 const char* WebInputEvent::GetName(WebInputEvent::Type type)
76 {
77 switch (type) {
78 CASE_TYPE(Undefined);
79 CASE_TYPE(MouseDown);
80 CASE_TYPE(MouseUp);
81 CASE_TYPE(MouseMove);
82 CASE_TYPE(MouseEnter);
83 CASE_TYPE(MouseLeave);
84 CASE_TYPE(ContextMenu);
85 CASE_TYPE(MouseWheel);
86 CASE_TYPE(RawKeyDown);
87 CASE_TYPE(KeyDown);
88 CASE_TYPE(KeyUp);
89 CASE_TYPE(Char);
90 CASE_TYPE(GestureScrollBegin);
91 CASE_TYPE(GestureScrollEnd);
92 CASE_TYPE(GestureScrollUpdate);
93 CASE_TYPE(GestureFlingStart);
94 CASE_TYPE(GestureFlingCancel);
95 CASE_TYPE(GestureShowPress);
96 CASE_TYPE(GestureTap);
97 CASE_TYPE(GestureTapUnconfirmed);
98 CASE_TYPE(GestureTapDown);
99 CASE_TYPE(GestureTapCancel);
100 CASE_TYPE(GestureDoubleTap);
101 CASE_TYPE(GestureTwoFingerTap);
102 CASE_TYPE(GestureLongPress);
103 CASE_TYPE(GestureLongTap);
104 CASE_TYPE(GesturePinchBegin);
105 CASE_TYPE(GesturePinchEnd);
106 CASE_TYPE(GesturePinchUpdate);
107 CASE_TYPE(TouchStart);
108 CASE_TYPE(TouchMove);
109 CASE_TYPE(TouchEnd);
110 CASE_TYPE(TouchCancel);
111 CASE_TYPE(TouchScrollStarted);
112 default:
113 NOTREACHED();
114 return "";
115 }
116 }
117 #undef CASE_TYPE
118
73 } // namespace blink 119 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698