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

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

Issue 2478423002: Rename SyntheticPointer to SyntheticPointerDriver (Closed)
Patch Set: rename Created 4 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
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "content/browser/renderer_host/input/synthetic_touch_driver.h"
6
7 #include "content/browser/renderer_host/input/synthetic_gesture_target.h"
8
9 namespace content {
10
11 SyntheticTouchDriver::SyntheticTouchDriver() {
12 std::fill(index_map_.begin(), index_map_.end(), -1);
13 }
14
15 SyntheticTouchDriver::SyntheticTouchDriver(SyntheticWebTouchEvent touch_event)
16 : touch_event_(touch_event) {
17 std::fill(index_map_.begin(), index_map_.end(), -1);
18 }
19
20 SyntheticTouchDriver::~SyntheticTouchDriver() {}
21
22 void SyntheticTouchDriver::DispatchEvent(SyntheticGestureTarget* target,
23 const base::TimeTicks& timestamp) {
24 touch_event_.timeStampSeconds = ConvertTimestampToSeconds(timestamp);
25 target->DispatchInputEventToPlatform(touch_event_);
26 }
27
28 int SyntheticTouchDriver::Press(int index,
29 float x,
30 float y,
31 SyntheticGestureTarget* target,
32 const base::TimeTicks& timestamp) {
33 int point_index = touch_event_.PressPoint(x, y);
34 index_map_[index] = point_index;
35 return index;
36 }
37
38 void SyntheticTouchDriver::Move(int index,
39 float x,
40 float y,
41 SyntheticGestureTarget* target,
42 const base::TimeTicks& timestamp) {
43 touch_event_.MovePoint(index_map_[index], x, y);
44 }
45
46 void SyntheticTouchDriver::Release(int index,
47 SyntheticGestureTarget* target,
48 const base::TimeTicks& timestamp) {
49 touch_event_.ReleasePoint(index_map_[index]);
50 index_map_[index] = -1;
51 }
52
53 SyntheticGestureParams::GestureSourceType SyntheticTouchDriver::SourceType()
54 const {
55 return SyntheticGestureParams::TOUCH_INPUT;
56 }
57
58 int SyntheticTouchDriver::GetPointIndex(int index) const {
59 return index_map_[index];
60 }
61
62 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698