Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 252 return isMouseEventType(other.type); | 252 return isMouseEventType(other.type); |
| 253 if (isGestureEventType(type)) | 253 if (isGestureEventType(type)) |
| 254 return isGestureEventType(other.type); | 254 return isGestureEventType(other.type); |
| 255 if (isTouchEventType(type)) | 255 if (isTouchEventType(type)) |
| 256 return isTouchEventType(other.type); | 256 return isTouchEventType(other.type); |
| 257 if (isKeyboardEventType(type)) | 257 if (isKeyboardEventType(type)) |
| 258 return isKeyboardEventType(other.type); | 258 return isKeyboardEventType(other.type); |
| 259 return type == other.type; | 259 return type == other.type; |
| 260 } | 260 } |
| 261 | 261 |
| 262 #define CASE_TYPE(t) case WebInputEvent::t: return #t | |
| 263 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.
| |
| 264 { | |
| 265 switch (type) { | |
| 266 CASE_TYPE(Undefined); | |
| 267 CASE_TYPE(MouseDown); | |
| 268 CASE_TYPE(MouseUp); | |
| 269 CASE_TYPE(MouseMove); | |
| 270 CASE_TYPE(MouseEnter); | |
| 271 CASE_TYPE(MouseLeave); | |
| 272 CASE_TYPE(ContextMenu); | |
| 273 CASE_TYPE(MouseWheel); | |
| 274 CASE_TYPE(RawKeyDown); | |
| 275 CASE_TYPE(KeyDown); | |
| 276 CASE_TYPE(KeyUp); | |
| 277 CASE_TYPE(Char); | |
| 278 CASE_TYPE(GestureScrollBegin); | |
| 279 CASE_TYPE(GestureScrollEnd); | |
| 280 CASE_TYPE(GestureScrollUpdate); | |
| 281 CASE_TYPE(GestureFlingStart); | |
| 282 CASE_TYPE(GestureFlingCancel); | |
| 283 CASE_TYPE(GestureShowPress); | |
| 284 CASE_TYPE(GestureTap); | |
| 285 CASE_TYPE(GestureTapUnconfirmed); | |
| 286 CASE_TYPE(GestureTapDown); | |
| 287 CASE_TYPE(GestureTapCancel); | |
| 288 CASE_TYPE(GestureDoubleTap); | |
| 289 CASE_TYPE(GestureTwoFingerTap); | |
| 290 CASE_TYPE(GestureLongPress); | |
| 291 CASE_TYPE(GestureLongTap); | |
| 292 CASE_TYPE(GesturePinchBegin); | |
| 293 CASE_TYPE(GesturePinchEnd); | |
| 294 CASE_TYPE(GesturePinchUpdate); | |
| 295 CASE_TYPE(TouchStart); | |
| 296 CASE_TYPE(TouchMove); | |
| 297 CASE_TYPE(TouchEnd); | |
| 298 CASE_TYPE(TouchCancel); | |
| 299 CASE_TYPE(TouchScrollStarted); | |
| 300 default: | |
| 301 NOTREACHED(); | |
| 302 return ""; | |
| 303 } | |
| 304 } | |
| 305 #undef CASE_TYPE | |
| 306 | |
| 262 protected: | 307 protected: |
| 263 explicit WebInputEvent(unsigned sizeParam) | 308 explicit WebInputEvent(unsigned sizeParam) |
| 264 { | 309 { |
| 265 memset(this, 0, sizeParam); | 310 memset(this, 0, sizeParam); |
| 266 timeStampSeconds = 0.0; | 311 timeStampSeconds = 0.0; |
| 267 size = sizeParam; | 312 size = sizeParam; |
| 268 type = Undefined; | 313 type = Undefined; |
| 269 modifiers = 0; | 314 modifiers = 0; |
| 270 } | 315 } |
| 271 }; | 316 }; |
| (...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 637 , uniqueTouchEventId(0) | 682 , uniqueTouchEventId(0) |
| 638 { | 683 { |
| 639 } | 684 } |
| 640 }; | 685 }; |
| 641 | 686 |
| 642 #pragma pack(pop) | 687 #pragma pack(pop) |
| 643 | 688 |
| 644 } // namespace blink | 689 } // namespace blink |
| 645 | 690 |
| 646 #endif | 691 #endif |
| OLD | NEW |