| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #include "content/browser/renderer_host/input/synthetic_gesture.h" | 5 #include "content/browser/renderer_host/input/synthetic_gesture.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "content/browser/renderer_host/input/synthetic_gesture_target.h" | 8 #include "content/browser/renderer_host/input/synthetic_gesture_target.h" |
| 9 #include "content/browser/renderer_host/input/synthetic_pinch_gesture.h" | 9 #include "content/browser/renderer_host/input/synthetic_pinch_gesture.h" |
| 10 #include "content/browser/renderer_host/input/synthetic_pointer_action.h" |
| 10 #include "content/browser/renderer_host/input/synthetic_smooth_drag_gesture.h" | 11 #include "content/browser/renderer_host/input/synthetic_smooth_drag_gesture.h" |
| 11 #include "content/browser/renderer_host/input/synthetic_smooth_scroll_gesture.h" | 12 #include "content/browser/renderer_host/input/synthetic_smooth_scroll_gesture.h" |
| 12 #include "content/browser/renderer_host/input/synthetic_tap_gesture.h" | 13 #include "content/browser/renderer_host/input/synthetic_tap_gesture.h" |
| 13 | 14 |
| 14 namespace content { | 15 namespace content { |
| 15 namespace { | 16 namespace { |
| 16 | 17 |
| 17 template <typename GestureType, typename GestureParamsType> | 18 template <typename GestureType, typename GestureParamsType> |
| 18 static scoped_ptr<SyntheticGesture> CreateGesture( | 19 static scoped_ptr<SyntheticGesture> CreateGesture( |
| 19 const SyntheticGestureParams& gesture_params) { | 20 const SyntheticGestureParams& gesture_params) { |
| (...skipping 15 matching lines...) Expand all Loading... |
| 35 SyntheticSmoothScrollGestureParams>(gesture_params); | 36 SyntheticSmoothScrollGestureParams>(gesture_params); |
| 36 case SyntheticGestureParams::SMOOTH_DRAG_GESTURE: | 37 case SyntheticGestureParams::SMOOTH_DRAG_GESTURE: |
| 37 return CreateGesture<SyntheticSmoothDragGesture, | 38 return CreateGesture<SyntheticSmoothDragGesture, |
| 38 SyntheticSmoothDragGestureParams>(gesture_params); | 39 SyntheticSmoothDragGestureParams>(gesture_params); |
| 39 case SyntheticGestureParams::PINCH_GESTURE: | 40 case SyntheticGestureParams::PINCH_GESTURE: |
| 40 return CreateGesture<SyntheticPinchGesture, | 41 return CreateGesture<SyntheticPinchGesture, |
| 41 SyntheticPinchGestureParams>(gesture_params); | 42 SyntheticPinchGestureParams>(gesture_params); |
| 42 case SyntheticGestureParams::TAP_GESTURE: | 43 case SyntheticGestureParams::TAP_GESTURE: |
| 43 return CreateGesture<SyntheticTapGesture, | 44 return CreateGesture<SyntheticTapGesture, |
| 44 SyntheticTapGestureParams>(gesture_params); | 45 SyntheticTapGestureParams>(gesture_params); |
| 46 case SyntheticGestureParams::POINTER_ACTION: |
| 47 return CreateGesture<SyntheticPointerAction, |
| 48 SyntheticPointerActionParams>(gesture_params); |
| 45 } | 49 } |
| 46 NOTREACHED() << "Invalid synthetic gesture type"; | 50 NOTREACHED() << "Invalid synthetic gesture type"; |
| 47 return scoped_ptr<SyntheticGesture>(); | 51 return scoped_ptr<SyntheticGesture>(); |
| 48 } | 52 } |
| 49 | 53 |
| 50 } // namespace content | 54 } // namespace content |
| OLD | NEW |