| OLD | NEW |
| 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 #ifndef CONTENT_BROWSER_RENDERER_HOST_INPUT_SYNTHETIC_TOUCH_POINTER_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_INPUT_SYNTHETIC_TOUCH_DRIVER_H_ |
| 6 #define CONTENT_BROWSER_RENDERER_HOST_INPUT_SYNTHETIC_TOUCH_POINTER_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_INPUT_SYNTHETIC_TOUCH_DRIVER_H_ |
| 7 | 7 |
| 8 #include <array> |
| 8 #include "base/macros.h" | 9 #include "base/macros.h" |
| 9 #include "content/browser/renderer_host/input/synthetic_pointer.h" | 10 #include "content/browser/renderer_host/input/synthetic_pointer_driver.h" |
| 10 #include "content/common/content_export.h" | 11 #include "content/common/content_export.h" |
| 11 #include "content/common/input/synthetic_web_input_event_builders.h" | 12 #include "content/common/input/synthetic_web_input_event_builders.h" |
| 12 | 13 |
| 13 namespace content { | 14 namespace content { |
| 14 | 15 |
| 15 class CONTENT_EXPORT SyntheticTouchPointer : public SyntheticPointer { | 16 class CONTENT_EXPORT SyntheticTouchDriver : public SyntheticPointerDriver { |
| 16 public: | 17 public: |
| 17 SyntheticTouchPointer(); | 18 using IndexMap = std::array<int, blink::WebTouchEvent::kTouchesLengthCap>; |
| 18 explicit SyntheticTouchPointer(SyntheticWebTouchEvent touch_event); | 19 |
| 19 ~SyntheticTouchPointer() override; | 20 SyntheticTouchDriver(); |
| 21 explicit SyntheticTouchDriver(SyntheticWebTouchEvent touch_event); |
| 22 ~SyntheticTouchDriver() override; |
| 20 | 23 |
| 21 void DispatchEvent(SyntheticGestureTarget* target, | 24 void DispatchEvent(SyntheticGestureTarget* target, |
| 22 const base::TimeTicks& timestamp) override; | 25 const base::TimeTicks& timestamp) override; |
| 23 | 26 |
| 24 int Press(float x, | 27 int Press(int index, |
| 28 float x, |
| 25 float y, | 29 float y, |
| 26 SyntheticGestureTarget* target, | 30 SyntheticGestureTarget* target, |
| 27 const base::TimeTicks& timestamp) override; | 31 const base::TimeTicks& timestamp) override; |
| 28 void Move(int index, | 32 void Move(int index, |
| 29 float x, | 33 float x, |
| 30 float y, | 34 float y, |
| 31 SyntheticGestureTarget* target, | 35 SyntheticGestureTarget* target, |
| 32 const base::TimeTicks& timestamp) override; | 36 const base::TimeTicks& timestamp) override; |
| 33 void Release(int index, | 37 void Release(int index, |
| 34 SyntheticGestureTarget* target, | 38 SyntheticGestureTarget* target, |
| 35 const base::TimeTicks& timestamp) override; | 39 const base::TimeTicks& timestamp) override; |
| 36 | 40 |
| 37 SyntheticGestureParams::GestureSourceType SourceType() const override; | 41 SyntheticGestureParams::GestureSourceType SourceType() const override; |
| 38 | 42 |
| 43 int GetPointIndex(int index) const override; |
| 44 |
| 39 private: | 45 private: |
| 40 SyntheticWebTouchEvent touch_event_; | 46 SyntheticWebTouchEvent touch_event_; |
| 47 IndexMap index_map_; |
| 41 | 48 |
| 42 DISALLOW_COPY_AND_ASSIGN(SyntheticTouchPointer); | 49 DISALLOW_COPY_AND_ASSIGN(SyntheticTouchDriver); |
| 43 }; | 50 }; |
| 44 | 51 |
| 45 } // namespace content | 52 } // namespace content |
| 46 | 53 |
| 47 #endif // CONTENT_COMMON_INPUT_SYNTHETIC_TOUCH_POINTER_H_ | 54 #endif // CONTENT_COMMON_INPUT_SYNTHETIC_TOUCH_DRIVER_H_ |
| OLD | NEW |