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

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

Issue 2569273002: Add constructors to WebInputEvents and setters so we can work at cleaning up these public structs. (Closed)
Patch Set: Fix mouse up event sender not modifying modifiers Created 4 years 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 2015 The Chromium Authors. All rights reserved. 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 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_touch_driver.h" 5 #include "content/browser/renderer_host/input/synthetic_touch_driver.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 8
9 using blink::WebTouchEvent; 9 using blink::WebTouchEvent;
10 10
11 namespace content { 11 namespace content {
12 12
13 SyntheticTouchDriver::SyntheticTouchDriver() {} 13 SyntheticTouchDriver::SyntheticTouchDriver() {}
14 14
15 SyntheticTouchDriver::SyntheticTouchDriver(SyntheticWebTouchEvent touch_event) 15 SyntheticTouchDriver::SyntheticTouchDriver(SyntheticWebTouchEvent touch_event)
16 : touch_event_(touch_event) {} 16 : touch_event_(touch_event) {}
17 17
18 SyntheticTouchDriver::~SyntheticTouchDriver() {} 18 SyntheticTouchDriver::~SyntheticTouchDriver() {}
19 19
20 void SyntheticTouchDriver::DispatchEvent(SyntheticGestureTarget* target, 20 void SyntheticTouchDriver::DispatchEvent(SyntheticGestureTarget* target,
21 const base::TimeTicks& timestamp) { 21 const base::TimeTicks& timestamp) {
22 touch_event_.timeStampSeconds = ConvertTimestampToSeconds(timestamp); 22 touch_event_.setTimeStampSeconds(ConvertTimestampToSeconds(timestamp));
23 target->DispatchInputEventToPlatform(touch_event_); 23 target->DispatchInputEventToPlatform(touch_event_);
24 } 24 }
25 25
26 int SyntheticTouchDriver::Press(float x, float y) { 26 int SyntheticTouchDriver::Press(float x, float y) {
27 int index = touch_event_.PressPoint(x, y); 27 int index = touch_event_.PressPoint(x, y);
28 return index; 28 return index;
29 } 29 }
30 30
31 void SyntheticTouchDriver::Move(float x, float y, int index) { 31 void SyntheticTouchDriver::Move(float x, float y, int index) {
32 touch_event_.MovePoint(index, x, y); 32 touch_event_.MovePoint(index, x, y);
(...skipping 30 matching lines...) Expand all
63 if (params.pointer_action_type() == 63 if (params.pointer_action_type() ==
64 SyntheticPointerActionParams::PointerActionType::RELEASE && 64 SyntheticPointerActionParams::PointerActionType::RELEASE &&
65 params.index() == -1) { 65 params.index() == -1) {
66 return false; 66 return false;
67 } 67 }
68 68
69 return true; 69 return true;
70 } 70 }
71 71
72 } // namespace content 72 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698