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

Side by Side Diff: third_party/WebKit/public/web/WebInputEvent.h

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

Powered by Google App Engine
This is Rietveld 408576698