| OLD | NEW |
| (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_pointer.h" | |
| 6 | |
| 7 #include "content/browser/renderer_host/input/synthetic_gesture_target.h" | |
| 8 | |
| 9 namespace content { | |
| 10 | |
| 11 SyntheticTouchPointer::SyntheticTouchPointer() {} | |
| 12 | |
| 13 SyntheticTouchPointer::SyntheticTouchPointer(SyntheticWebTouchEvent touch_event) | |
| 14 : touch_event_(touch_event) {} | |
| 15 | |
| 16 SyntheticTouchPointer::~SyntheticTouchPointer() {} | |
| 17 | |
| 18 void SyntheticTouchPointer::DispatchEvent(SyntheticGestureTarget* target, | |
| 19 const base::TimeTicks& timestamp) { | |
| 20 touch_event_.timeStampSeconds = ConvertTimestampToSeconds(timestamp); | |
| 21 target->DispatchInputEventToPlatform(touch_event_); | |
| 22 } | |
| 23 | |
| 24 int SyntheticTouchPointer::Press(float x, | |
| 25 float y, | |
| 26 SyntheticGestureTarget* target, | |
| 27 const base::TimeTicks& timestamp) { | |
| 28 int index = touch_event_.PressPoint(x, y); | |
| 29 return index; | |
| 30 } | |
| 31 | |
| 32 void SyntheticTouchPointer::Move(int index, | |
| 33 float x, | |
| 34 float y, | |
| 35 SyntheticGestureTarget* target, | |
| 36 const base::TimeTicks& timestamp) { | |
| 37 touch_event_.MovePoint(index, x, y); | |
| 38 } | |
| 39 | |
| 40 void SyntheticTouchPointer::Release(int index, | |
| 41 SyntheticGestureTarget* target, | |
| 42 const base::TimeTicks& timestamp) { | |
| 43 touch_event_.ReleasePoint(index); | |
| 44 } | |
| 45 | |
| 46 SyntheticGestureParams::GestureSourceType SyntheticTouchPointer::SourceType() | |
| 47 const { | |
| 48 return SyntheticGestureParams::TOUCH_INPUT; | |
| 49 } | |
| 50 | |
| 51 } // namespace content | |
| OLD | NEW |