| 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 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 IsComposing = 1 << 14, | 183 IsComposing = 1 << 14, |
| 184 | 184 |
| 185 AltGrKey = 1 << 15, | 185 AltGrKey = 1 << 15, |
| 186 OSKey = 1 << 16, | 186 OSKey = 1 << 16, |
| 187 FnKey = 1 << 17, | 187 FnKey = 1 << 17, |
| 188 SymbolKey = 1 << 18, | 188 SymbolKey = 1 << 18, |
| 189 | 189 |
| 190 ScrollLockOn = 1 << 19, | 190 ScrollLockOn = 1 << 19, |
| 191 }; | 191 }; |
| 192 | 192 |
| 193 // Indicates whether the browser needs to block on the ACK result for |
| 194 // this event, and if not why note (for metrics/diagnostics purposes). |
| 195 // These values are direct mappings of the values in PlatformEvent |
| 196 // so the values can be cast between the enumerations. static_asserts |
| 197 // checking this are in web/WebInputEventConversion.cpp. |
| 198 enum DispatchType { |
| 199 // Event can be canceled. |
| 200 Blocking, |
| 201 // Event can not be canceled. |
| 202 EventNonBlocking, |
| 203 // All listeners are passive; not cancelable. |
| 204 ListenersNonBlockingPassive, |
| 205 // This value represents a state which would have normally blocking |
| 206 // but was forced to be non-blocking; not cancelable. |
| 207 ListenersForcedNonBlockingPassive, |
| 208 }; |
| 209 |
| 193 // The rail mode for a wheel event specifies the axis on which scrolling is | 210 // The rail mode for a wheel event specifies the axis on which scrolling is |
| 194 // expected to stick. If this axis is set to Free, then scrolling is not | 211 // expected to stick. If this axis is set to Free, then scrolling is not |
| 195 // stuck to any axis. | 212 // stuck to any axis. |
| 196 enum RailsMode { | 213 enum RailsMode { |
| 197 RailsModeFree = 0, | 214 RailsModeFree = 0, |
| 198 RailsModeHorizontal = 1, | 215 RailsModeHorizontal = 1, |
| 199 RailsModeVertical = 2, | 216 RailsModeVertical = 2, |
| 200 }; | 217 }; |
| 201 | 218 |
| 202 static const int InputModifiers = ShiftKey | ControlKey | AltKey | MetaKey; | 219 static const int InputModifiers = ShiftKey | ControlKey | AltKey | MetaKey; |
| (...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 596 class WebTouchEvent : public WebInputEvent { | 613 class WebTouchEvent : public WebInputEvent { |
| 597 public: | 614 public: |
| 598 // Maximum number of simultaneous touches supported on | 615 // Maximum number of simultaneous touches supported on |
| 599 // Ash/Aura. | 616 // Ash/Aura. |
| 600 enum { touchesLengthCap = 16 }; | 617 enum { touchesLengthCap = 16 }; |
| 601 | 618 |
| 602 unsigned touchesLength; | 619 unsigned touchesLength; |
| 603 // List of all touches, regardless of state. | 620 // List of all touches, regardless of state. |
| 604 WebTouchPoint touches[touchesLengthCap]; | 621 WebTouchPoint touches[touchesLengthCap]; |
| 605 | 622 |
| 606 // Whether the event can be canceled (with preventDefault). If true then the
browser | 623 // Whether the event is blocking, non-blocking, all event |
| 607 // must wait for an ACK for this event. If false then no ACK IPC is expected
. | 624 // listeners were passive or was forced to be non-blocking. |
| 608 bool cancelable; | 625 DispatchType dispatchType; |
| 609 | 626 |
| 610 // For a single touch, this is true after the touch-point has moved beyond | 627 // For a single touch, this is true after the touch-point has moved beyond |
| 611 // the platform slop region. For a multitouch, this is true after any | 628 // the platform slop region. For a multitouch, this is true after any |
| 612 // touch-point has moved (by whatever amount). | 629 // touch-point has moved (by whatever amount). |
| 613 bool movedBeyondSlopRegion; | 630 bool movedBeyondSlopRegion; |
| 614 | 631 |
| 615 // A unique identifier for the touch event. | 632 // A unique identifier for the touch event. |
| 616 uint32_t uniqueTouchEventId; | 633 uint32_t uniqueTouchEventId; |
| 617 | 634 |
| 618 WebTouchEvent() | 635 WebTouchEvent() |
| 619 : WebInputEvent(sizeof(WebTouchEvent)) | 636 : WebInputEvent(sizeof(WebTouchEvent)) |
| 620 , touchesLength(0) | 637 , touchesLength(0) |
| 621 , cancelable(true) | 638 , dispatchType(Blocking) |
| 622 , movedBeyondSlopRegion(false) | 639 , movedBeyondSlopRegion(false) |
| 623 , uniqueTouchEventId(0) | 640 , uniqueTouchEventId(0) |
| 624 { | 641 { |
| 625 } | 642 } |
| 626 }; | 643 }; |
| 627 | 644 |
| 628 #pragma pack(pop) | 645 #pragma pack(pop) |
| 629 | 646 |
| 630 } // namespace blink | 647 } // namespace blink |
| 631 | 648 |
| 632 #endif | 649 #endif |
| OLD | NEW |