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

Side by Side Diff: content/browser/renderer_host/input/synthetic_gesture.cc

Issue 62443007: Replace old with new synthetic gesture framework. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: opt_mouse_move_event_x/y -> opt_start_x/y Created 7 years, 1 month 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 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_new.h" 5 #include "content/browser/renderer_host/input/synthetic_gesture.h"
6 6
7 #include "content/browser/renderer_host/input/synthetic_gesture_target.h" 7 #include "content/browser/renderer_host/input/synthetic_gesture_target.h"
8 #include "content/browser/renderer_host/input/synthetic_pinch_gesture_new.h" 8 #include "content/browser/renderer_host/input/synthetic_pinch_gesture.h"
9 #include "content/browser/renderer_host/input/synthetic_smooth_scroll_gesture_ne w.h" 9 #include "content/browser/renderer_host/input/synthetic_smooth_scroll_gesture.h"
10 10
11 namespace content { 11 namespace content {
12 namespace { 12 namespace {
13 13
14 template <typename GestureType, typename GestureParamsType> 14 template <typename GestureType, typename GestureParamsType>
15 static scoped_ptr<SyntheticGestureNew> CreateGesture( 15 static scoped_ptr<SyntheticGesture> CreateGesture(
16 const SyntheticGestureParams& gesture_params) { 16 const SyntheticGestureParams& gesture_params) {
17 return scoped_ptr<SyntheticGestureNew>( 17 return scoped_ptr<SyntheticGesture>(
18 new GestureType(*GestureParamsType::Cast(&gesture_params))); 18 new GestureType(*GestureParamsType::Cast(&gesture_params)));
19 } 19 }
20 20
21 } // namespace 21 } // namespace
22 22
23 SyntheticGestureNew::SyntheticGestureNew() {} 23 SyntheticGesture::SyntheticGesture() {}
24 24
25 SyntheticGestureNew::~SyntheticGestureNew() {} 25 SyntheticGesture::~SyntheticGesture() {}
26 26
27 scoped_ptr<SyntheticGestureNew> SyntheticGestureNew::Create( 27 scoped_ptr<SyntheticGesture> SyntheticGesture::Create(
28 const SyntheticGestureParams& gesture_params) { 28 const SyntheticGestureParams& gesture_params) {
29 switch (gesture_params.GetGestureType()) { 29 switch (gesture_params.GetGestureType()) {
30 case SyntheticGestureParams::SMOOTH_SCROLL_GESTURE: 30 case SyntheticGestureParams::SMOOTH_SCROLL_GESTURE:
31 return CreateGesture<SyntheticSmoothScrollGestureNew, 31 return CreateGesture<SyntheticSmoothScrollGesture,
32 SyntheticSmoothScrollGestureParams>(gesture_params); 32 SyntheticSmoothScrollGestureParams>(gesture_params);
33 case SyntheticGestureParams::PINCH_GESTURE: 33 case SyntheticGestureParams::PINCH_GESTURE:
34 return CreateGesture<SyntheticPinchGestureNew, 34 return CreateGesture<SyntheticPinchGesture,
35 SyntheticPinchGestureParams>(gesture_params); 35 SyntheticPinchGestureParams>(gesture_params);
36 } 36 }
37 NOTREACHED() << "Invalid synthetic gesture type"; 37 NOTREACHED() << "Invalid synthetic gesture type";
38 return scoped_ptr<SyntheticGestureNew>(); 38 return scoped_ptr<SyntheticGesture>();
39 } 39 }
40 40
41 } // namespace content 41 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698