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

Side by Side Diff: third_party/WebKit/public/platform/WebGestureEvent.h

Issue 2925883003: [Touch Adjustment] Pass primary_pointer_type to WebGestureEvent and disable adjustment for stylus (Closed)
Patch Set: Created 3 years, 6 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 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef WebGestureEvent_h 5 #ifndef WebGestureEvent_h
6 #define WebGestureEvent_h 6 #define WebGestureEvent_h
7 7
8 #include "WebFloatSize.h" 8 #include "WebFloatSize.h"
9 #include "WebGestureDevice.h" 9 #include "WebGestureDevice.h"
10 #include "WebInputEvent.h" 10 #include "WebInputEvent.h"
(...skipping 20 matching lines...) Expand all
31 }; 31 };
32 32
33 // TODO(mustaq): Make these coordinates private & fractional, as in 33 // TODO(mustaq): Make these coordinates private & fractional, as in
34 // WebMouseEvent.h . 34 // WebMouseEvent.h .
35 int x; 35 int x;
36 int y; 36 int y;
37 int global_x; 37 int global_x;
38 int global_y; 38 int global_y;
39 WebGestureDevice source_device; 39 WebGestureDevice source_device;
40 40
41 // |primary_pointer_type| is used to distinguish between finger-generated and
42 // stylus-generated gestures. This is important for touch adjustment.
43 WebPointerProperties::PointerType primary_pointer_type;
mustaq 2017/06/14 20:37:48 Please drop "primary_", there is only one type for
chongz 2017/06/14 23:53:23 dtapuska@ Are you ok with dropping "primary_"? Th
dtapuska 2017/06/15 14:47:23 Probably we should indicate that for a multi-conta
chongz 2017/06/15 21:40:08 Updated comments.
44
41 // If the WebGestureEvent has sourceDevice=WebGestureDeviceTouchscreen, this 45 // If the WebGestureEvent has sourceDevice=WebGestureDeviceTouchscreen, this
42 // field contains the unique identifier for the touch event that released 46 // field contains the unique identifier for the touch event that released
43 // this event at TouchDispositionGestureFilter. If the WebGestureEvents was 47 // this event at TouchDispositionGestureFilter. If the WebGestureEvents was
44 // not released through a touch event (e.g. timer-released gesture events or 48 // not released through a touch event (e.g. timer-released gesture events or
45 // gesture events with sourceDevice!=WebGestureDeviceTouchscreen), the field 49 // gesture events with sourceDevice!=WebGestureDeviceTouchscreen), the field
46 // contains 0. See crbug.com/618738. 50 // contains 0. See crbug.com/618738.
47 uint32_t unique_touch_event_id; 51 uint32_t unique_touch_event_id;
48 52
49 // This field exists to allow BrowserPlugin to mark GestureScroll events as 53 // This field exists to allow BrowserPlugin to mark GestureScroll events as
50 // 'resent' to handle the case where an event is not consumed when first 54 // 'resent' to handle the case where an event is not consumed when first
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 float scale; 161 float scale;
158 } pinch_update; 162 } pinch_update;
159 } data; 163 } data;
160 164
161 WebGestureEvent(Type type, int modifiers, double time_stamp_seconds) 165 WebGestureEvent(Type type, int modifiers, double time_stamp_seconds)
162 : WebInputEvent(sizeof(WebGestureEvent), 166 : WebInputEvent(sizeof(WebGestureEvent),
163 type, 167 type,
164 modifiers, 168 modifiers,
165 time_stamp_seconds), 169 time_stamp_seconds),
166 source_device(kWebGestureDeviceUninitialized), 170 source_device(kWebGestureDeviceUninitialized),
171 primary_pointer_type(WebPointerProperties::PointerType::kUnknown),
167 resending_plugin_id(-1) {} 172 resending_plugin_id(-1) {}
168 173
169 WebGestureEvent() 174 WebGestureEvent()
170 : WebInputEvent(sizeof(WebGestureEvent)), 175 : WebInputEvent(sizeof(WebGestureEvent)),
171 source_device(kWebGestureDeviceUninitialized), 176 source_device(kWebGestureDeviceUninitialized),
177 primary_pointer_type(WebPointerProperties::PointerType::kUnknown),
172 resending_plugin_id(-1) {} 178 resending_plugin_id(-1) {}
173 179
174 #if INSIDE_BLINK 180 #if INSIDE_BLINK
175 BLINK_PLATFORM_EXPORT float DeltaXInRootFrame() const; 181 BLINK_PLATFORM_EXPORT float DeltaXInRootFrame() const;
176 BLINK_PLATFORM_EXPORT float DeltaYInRootFrame() const; 182 BLINK_PLATFORM_EXPORT float DeltaYInRootFrame() const;
177 BLINK_PLATFORM_EXPORT ScrollUnits DeltaUnits() const; 183 BLINK_PLATFORM_EXPORT ScrollUnits DeltaUnits() const;
178 BLINK_PLATFORM_EXPORT WebFloatPoint PositionInRootFrame() const; 184 BLINK_PLATFORM_EXPORT WebFloatPoint PositionInRootFrame() const;
179 BLINK_PLATFORM_EXPORT float PinchScale() const; 185 BLINK_PLATFORM_EXPORT float PinchScale() const;
180 BLINK_PLATFORM_EXPORT InertialPhaseState InertialPhase() const; 186 BLINK_PLATFORM_EXPORT InertialPhaseState InertialPhase() const;
181 BLINK_PLATFORM_EXPORT bool Synthetic() const; 187 BLINK_PLATFORM_EXPORT bool Synthetic() const;
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 return false; 246 return false;
241 } 247 }
242 } 248 }
243 }; 249 };
244 250
245 #pragma pack(pop) 251 #pragma pack(pop)
246 252
247 } // namespace blink 253 } // namespace blink
248 254
249 #endif // WebGestureEvent_h 255 #endif // WebGestureEvent_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698