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 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 173 | 173 |
| 174 // WebTouchEvent - raw touch pointers not yet classified into gestures. | 174 // WebTouchEvent - raw touch pointers not yet classified into gestures. |
| 175 kTouchStart, | 175 kTouchStart, |
| 176 kTouchTypeFirst = kTouchStart, | 176 kTouchTypeFirst = kTouchStart, |
| 177 kTouchMove, | 177 kTouchMove, |
| 178 kTouchEnd, | 178 kTouchEnd, |
| 179 kTouchCancel, | 179 kTouchCancel, |
| 180 kTouchScrollStarted, | 180 kTouchScrollStarted, |
| 181 kTouchTypeLast = kTouchScrollStarted, | 181 kTouchTypeLast = kTouchScrollStarted, |
| 182 | 182 |
| 183 kPointerDown, | |
|
mustaq
2017/06/08 20:02:53
Add a "section header": // WebPointerEvent: work i
Navid Zolghadr
2017/06/08 21:18:41
Done.
| |
| 184 kPointerActionFirst = kPointerDown, | |
| 185 kPointerUp, | |
| 186 kPointerMove, | |
| 187 kPointerCancel, | |
| 188 kPointerActionLast = kPointerCancel, | |
|
mustaq
2017/06/08 20:02:53
s/kPointerAction.../kPointerType.../? Existing bl
Navid Zolghadr
2017/06/08 21:18:41
Done.
| |
| 189 | |
| 183 kTypeLast = kTouchTypeLast | 190 kTypeLast = kTouchTypeLast |
| 184 }; | 191 }; |
| 185 | 192 |
| 186 // The modifier constants cannot change their values since pepper | 193 // The modifier constants cannot change their values since pepper |
| 187 // does a 1-1 mapping of its values; see | 194 // does a 1-1 mapping of its values; see |
| 188 // content/renderer/pepper/event_conversion.cc | 195 // content/renderer/pepper/event_conversion.cc |
| 189 // | 196 // |
| 190 // A Java counterpart will be generated for this enum. | 197 // A Java counterpart will be generated for this enum. |
| 191 // GENERATED_JAVA_ENUM_PACKAGE: org.chromium.blink_public.web | 198 // GENERATED_JAVA_ENUM_PACKAGE: org.chromium.blink_public.web |
| 192 // GENERATED_JAVA_CLASS_NAME_OVERRIDE: WebInputEventModifier | 199 // GENERATED_JAVA_CLASS_NAME_OVERRIDE: WebInputEventModifier |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 302 | 309 |
| 303 bool IsSameEventClass(const WebInputEvent& other) const { | 310 bool IsSameEventClass(const WebInputEvent& other) const { |
| 304 if (IsMouseEventType(type_)) | 311 if (IsMouseEventType(type_)) |
| 305 return IsMouseEventType(other.type_); | 312 return IsMouseEventType(other.type_); |
| 306 if (IsGestureEventType(type_)) | 313 if (IsGestureEventType(type_)) |
| 307 return IsGestureEventType(other.type_); | 314 return IsGestureEventType(other.type_); |
| 308 if (IsTouchEventType(type_)) | 315 if (IsTouchEventType(type_)) |
| 309 return IsTouchEventType(other.type_); | 316 return IsTouchEventType(other.type_); |
| 310 if (IsKeyboardEventType(type_)) | 317 if (IsKeyboardEventType(type_)) |
| 311 return IsKeyboardEventType(other.type_); | 318 return IsKeyboardEventType(other.type_); |
| 312 return type_ == other.type_; | 319 return type_ == other.type_; |
|
mustaq
2017/06/08 20:02:53
Let's update this after adding a method IsPointerE
Navid Zolghadr
2017/06/08 21:18:41
Done.
| |
| 313 } | 320 } |
| 314 | 321 |
| 315 // Returns true if the WebInputEvent |type| is a pinch gesture event. | 322 // Returns true if the WebInputEvent |type| is a pinch gesture event. |
| 316 static bool IsPinchGestureEventType(WebInputEvent::Type type) { | 323 static bool IsPinchGestureEventType(WebInputEvent::Type type) { |
| 317 return kGesturePinchTypeFirst <= type && type <= kGesturePinchTypeLast; | 324 return kGesturePinchTypeFirst <= type && type <= kGesturePinchTypeLast; |
| 318 } | 325 } |
| 319 | 326 |
| 320 static const char* GetName(WebInputEvent::Type type) { | 327 static const char* GetName(WebInputEvent::Type type) { |
| 321 #define CASE_TYPE(t) \ | 328 #define CASE_TYPE(t) \ |
| 322 case WebInputEvent::k##t: \ | 329 case WebInputEvent::k##t: \ |
| (...skipping 25 matching lines...) Expand all Loading... | |
| 348 CASE_TYPE(GestureTwoFingerTap); | 355 CASE_TYPE(GestureTwoFingerTap); |
| 349 CASE_TYPE(GestureLongPress); | 356 CASE_TYPE(GestureLongPress); |
| 350 CASE_TYPE(GestureLongTap); | 357 CASE_TYPE(GestureLongTap); |
| 351 CASE_TYPE(GesturePinchBegin); | 358 CASE_TYPE(GesturePinchBegin); |
| 352 CASE_TYPE(GesturePinchEnd); | 359 CASE_TYPE(GesturePinchEnd); |
| 353 CASE_TYPE(GesturePinchUpdate); | 360 CASE_TYPE(GesturePinchUpdate); |
| 354 CASE_TYPE(TouchStart); | 361 CASE_TYPE(TouchStart); |
| 355 CASE_TYPE(TouchMove); | 362 CASE_TYPE(TouchMove); |
| 356 CASE_TYPE(TouchEnd); | 363 CASE_TYPE(TouchEnd); |
| 357 CASE_TYPE(TouchCancel); | 364 CASE_TYPE(TouchCancel); |
| 358 CASE_TYPE(TouchScrollStarted); | 365 CASE_TYPE(TouchScrollStarted); |
|
mustaq
2017/06/08 20:02:53
Please add the new event types here.
Getting rid
Navid Zolghadr
2017/06/08 21:18:41
Done.
| |
| 359 default: | 366 default: |
| 360 NOTREACHED(); | 367 NOTREACHED(); |
| 361 return ""; | 368 return ""; |
| 362 } | 369 } |
| 363 #undef CASE_TYPE | 370 #undef CASE_TYPE |
| 364 } | 371 } |
| 365 | 372 |
| 366 float FrameScale() const { return frame_scale_; } | 373 float FrameScale() const { return frame_scale_; } |
| 367 void SetFrameScale(float scale) { frame_scale_ = scale; } | 374 void SetFrameScale(float scale) { frame_scale_ = scale; } |
| 368 | 375 |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 430 unsigned size_; // The size of this structure, for serialization. | 437 unsigned size_; // The size of this structure, for serialization. |
| 431 Type type_; | 438 Type type_; |
| 432 int modifiers_; | 439 int modifiers_; |
| 433 }; | 440 }; |
| 434 | 441 |
| 435 #pragma pack(pop) | 442 #pragma pack(pop) |
| 436 | 443 |
| 437 } // namespace blink | 444 } // namespace blink |
| 438 | 445 |
| 439 #endif | 446 #endif |
| OLD | NEW |