Chromium Code Reviews| Index: content/browser/renderer_host/input/synthetic_gesture.cc |
| diff --git a/content/browser/renderer_host/input/synthetic_gesture.cc b/content/browser/renderer_host/input/synthetic_gesture.cc |
| index 2e25288dc1359d729aa835a63c965230360865ea..2b981a8703d9c62b9cd62fc53ae92aa2c7a91edf 100644 |
| --- a/content/browser/renderer_host/input/synthetic_gesture.cc |
| +++ b/content/browser/renderer_host/input/synthetic_gesture.cc |
| @@ -6,10 +6,11 @@ |
| #include "base/logging.h" |
| #include "content/browser/renderer_host/input/synthetic_gesture_target.h" |
| -#include "content/browser/renderer_host/input/synthetic_pinch_gesture.h" |
| #include "content/browser/renderer_host/input/synthetic_smooth_drag_gesture.h" |
| #include "content/browser/renderer_host/input/synthetic_smooth_scroll_gesture.h" |
| #include "content/browser/renderer_host/input/synthetic_tap_gesture.h" |
| +#include "content/browser/renderer_host/input/synthetic_touchpad_pinch_gesture.h" |
| +#include "content/browser/renderer_host/input/synthetic_touchscreen_pinch_gesture.h" |
| namespace content { |
| namespace { |
| @@ -37,8 +38,20 @@ scoped_ptr<SyntheticGesture> SyntheticGesture::Create( |
| return CreateGesture<SyntheticSmoothDragGesture, |
| SyntheticSmoothDragGestureParams>(gesture_params); |
| case SyntheticGestureParams::PINCH_GESTURE: |
| - return CreateGesture<SyntheticPinchGesture, |
| - SyntheticPinchGestureParams>(gesture_params); |
| + // TODO(ericrk): Wire this all the way through to the python/js libraries |
| + // and create a SyntheticTouchscreenGestureParams/ |
| + // SyntheticTouchpadGestureParams, removing the need for any |
| + // special-casing. |
| + if (SyntheticGestureParams::IsGestureSourceTypeSupported( |
|
jdduke (slow)
2015/09/22 18:52:37
Hmm, in theory |gesture_params| can specify either
ericrk
2015/09/22 21:46:26
Makes sense. Went with the thin wrapper approach,
|
| + SyntheticGestureParams::TOUCH_INPUT)) { |
| + // Only create a touchscreen gesture if we have touch input. If we |
| + // report default or mouse input, create a touchpad gesture. |
| + return CreateGesture<SyntheticTouchscreenPinchGesture, |
| + SyntheticPinchGestureParams>(gesture_params); |
| + } else { |
| + return CreateGesture<SyntheticTouchpadPinchGesture, |
| + SyntheticPinchGestureParams>(gesture_params); |
| + } |
| case SyntheticGestureParams::TAP_GESTURE: |
| return CreateGesture<SyntheticTapGesture, |
| SyntheticTapGestureParams>(gesture_params); |