OLD | NEW |
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 "WebGestureDevice.h" | 9 #include "WebGestureDevice.h" |
9 #include "WebInputEvent.h" | 10 #include "WebInputEvent.h" |
10 | 11 |
11 namespace blink { | 12 namespace blink { |
12 | 13 |
13 // See WebInputEvent.h for details why this pack is here. | 14 // See WebInputEvent.h for details why this pack is here. |
14 #pragma pack(push, 4) | 15 #pragma pack(push, 4) |
15 | 16 |
16 // WebGestureEvent --------------------------------------------------------- | 17 // WebGestureEvent --------------------------------------------------------- |
17 | 18 |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 } data; | 156 } data; |
156 | 157 |
157 WebGestureEvent() | 158 WebGestureEvent() |
158 : WebInputEvent(sizeof(WebGestureEvent)), | 159 : WebInputEvent(sizeof(WebGestureEvent)), |
159 x(0), | 160 x(0), |
160 y(0), | 161 y(0), |
161 globalX(0), | 162 globalX(0), |
162 globalY(0), | 163 globalY(0), |
163 sourceDevice(WebGestureDeviceUninitialized), | 164 sourceDevice(WebGestureDeviceUninitialized), |
164 resendingPluginId(-1) {} | 165 resendingPluginId(-1) {} |
| 166 |
| 167 #if INSIDE_BLINK |
| 168 BLINK_PLATFORM_EXPORT float deltaXInRootFrame() const; |
| 169 BLINK_PLATFORM_EXPORT float deltaYInRootFrame() const; |
| 170 BLINK_PLATFORM_EXPORT ScrollUnits deltaUnits() const; |
| 171 BLINK_PLATFORM_EXPORT WebFloatPoint positionInRootFrame() const; |
| 172 BLINK_PLATFORM_EXPORT float pinchScale() const; |
| 173 BLINK_PLATFORM_EXPORT InertialPhaseState inertialPhase() const; |
| 174 BLINK_PLATFORM_EXPORT bool synthetic() const; |
| 175 |
| 176 BLINK_PLATFORM_EXPORT float velocityX() const; |
| 177 BLINK_PLATFORM_EXPORT float velocityY() const; |
| 178 |
| 179 BLINK_PLATFORM_EXPORT WebFloatSize tapAreaInRootFrame() const; |
| 180 BLINK_PLATFORM_EXPORT int tapCount() const; |
| 181 |
| 182 BLINK_PLATFORM_EXPORT void applyTouchAdjustment( |
| 183 WebFloatPoint rootFrameCoords); |
| 184 |
| 185 // Sets any scaled values to be their computed values and sets |frameScale| |
| 186 // back to 1 and |translateX|, |translateY| back to 0. |
| 187 BLINK_PLATFORM_EXPORT void flattenTransform(); |
| 188 |
| 189 bool preventPropagation() const { |
| 190 // TODO(tdresser) Once we've decided if we're getting rid of scroll |
| 191 // chaining, we should remove all scroll chaining related logic. See |
| 192 // crbug.com/526462 for details. |
| 193 DCHECK(type == WebInputEvent::GestureScrollUpdate); |
| 194 return true; |
| 195 } |
| 196 |
| 197 bool isScrollEvent() const { |
| 198 switch (type) { |
| 199 case GestureScrollBegin: |
| 200 case GestureScrollEnd: |
| 201 case GestureScrollUpdate: |
| 202 case GestureFlingStart: |
| 203 case GesturePinchBegin: |
| 204 case GesturePinchEnd: |
| 205 case GesturePinchUpdate: |
| 206 return true; |
| 207 case GestureTap: |
| 208 case GestureTapUnconfirmed: |
| 209 case GestureTapDown: |
| 210 case GestureShowPress: |
| 211 case GestureTapCancel: |
| 212 case GestureTwoFingerTap: |
| 213 case GestureLongPress: |
| 214 case GestureLongTap: |
| 215 return false; |
| 216 default: |
| 217 NOTREACHED(); |
| 218 return false; |
| 219 } |
| 220 } |
| 221 |
| 222 #endif |
165 }; | 223 }; |
166 | 224 |
167 #pragma pack(pop) | 225 #pragma pack(pop) |
168 | 226 |
169 } // namespace blink | 227 } // namespace blink |
170 | 228 |
171 #endif // WebGestureEvent_h | 229 #endif // WebGestureEvent_h |
OLD | NEW |