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_DRIVER_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_INPUT_SYNTHETIC_TOUCH_DRIVER_H_ |
6 #define CONTENT_BROWSER_RENDERER_HOST_INPUT_SYNTHETIC_TOUCH_DRIVER_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_INPUT_SYNTHETIC_TOUCH_DRIVER_H_ |
7 | 7 |
8 #include <array> | 8 #include <array> |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "content/browser/renderer_host/input/synthetic_pointer_driver.h" | 10 #include "content/browser/renderer_host/input/synthetic_pointer_driver.h" |
11 #include "content/common/content_export.h" | 11 #include "content/common/content_export.h" |
12 #include "content/common/input/synthetic_web_input_event_builders.h" | 12 #include "content/common/input/synthetic_web_input_event_builders.h" |
13 | 13 |
14 using blink::WebTouchEvent; | |
15 | |
14 namespace content { | 16 namespace content { |
15 | 17 |
16 class CONTENT_EXPORT SyntheticTouchDriver : public SyntheticPointerDriver { | 18 class CONTENT_EXPORT SyntheticTouchDriver : public SyntheticPointerDriver { |
17 public: | 19 public: |
18 SyntheticTouchDriver(); | 20 SyntheticTouchDriver(); |
19 explicit SyntheticTouchDriver(SyntheticWebTouchEvent touch_event); | 21 explicit SyntheticTouchDriver(SyntheticWebTouchEvent touch_event); |
20 ~SyntheticTouchDriver() override; | 22 ~SyntheticTouchDriver() override; |
21 | 23 |
22 void DispatchEvent(SyntheticGestureTarget* target, | 24 void DispatchEvent(SyntheticGestureTarget* target, |
23 const base::TimeTicks& timestamp) override; | 25 const base::TimeTicks& timestamp) override; |
24 | 26 |
25 int Press(float x, float y) override; | 27 void Press(float x, float y, int index) override; |
26 void Move(float x, float y, int index) override; | 28 void Move(float x, float y, int index) override; |
27 void Release(int index) override; | 29 void Release(int index) override; |
28 | 30 |
29 bool UserInputCheck( | 31 bool UserInputCheck( |
30 const SyntheticPointerActionParams& params) const override; | 32 const SyntheticPointerActionParams& params) const override; |
31 | 33 |
32 private: | 34 private: |
35 using IndexMap = std::array<int, WebTouchEvent::kTouchesLengthCap>; | |
samuong
2016/12/21 00:02:27
I think you should just write blink::WebTouchEvent
lanwei
2016/12/21 20:01:14
Done.
| |
36 | |
33 SyntheticWebTouchEvent touch_event_; | 37 SyntheticWebTouchEvent touch_event_; |
38 IndexMap index_map_; | |
39 | |
34 DISALLOW_COPY_AND_ASSIGN(SyntheticTouchDriver); | 40 DISALLOW_COPY_AND_ASSIGN(SyntheticTouchDriver); |
35 }; | 41 }; |
36 | 42 |
37 } // namespace content | 43 } // namespace content |
38 | 44 |
39 #endif // CONTENT_COMMON_INPUT_SYNTHETIC_TOUCH_DRIVER_H_ | 45 #endif // CONTENT_COMMON_INPUT_SYNTHETIC_TOUCH_DRIVER_H_ |
OLD | NEW |