| 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_POINTER_DRIVER_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_INPUT_SYNTHETIC_POINTER_DRIVER_H_ |
| 6 #define CONTENT_BROWSER_RENDERER_HOST_INPUT_SYNTHETIC_POINTER_DRIVER_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_INPUT_SYNTHETIC_POINTER_DRIVER_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 public: | 21 public: |
| 22 SyntheticPointerDriver(); | 22 SyntheticPointerDriver(); |
| 23 virtual ~SyntheticPointerDriver(); | 23 virtual ~SyntheticPointerDriver(); |
| 24 | 24 |
| 25 static std::unique_ptr<SyntheticPointerDriver> Create( | 25 static std::unique_ptr<SyntheticPointerDriver> Create( |
| 26 SyntheticGestureParams::GestureSourceType gesture_source_type); | 26 SyntheticGestureParams::GestureSourceType gesture_source_type); |
| 27 | 27 |
| 28 virtual void DispatchEvent(SyntheticGestureTarget* target, | 28 virtual void DispatchEvent(SyntheticGestureTarget* target, |
| 29 const base::TimeTicks& timestamp) = 0; | 29 const base::TimeTicks& timestamp) = 0; |
| 30 | 30 |
| 31 virtual int Press(float x, float y) = 0; | 31 virtual void Press(float x, float y, int index = 0) = 0; |
| 32 virtual void Move(float x, float y, int index = 0) = 0; | 32 virtual void Move(float x, float y, int index = 0) = 0; |
| 33 virtual void Release(int index = 0) = 0; | 33 virtual void Release(int index = 0) = 0; |
| 34 | 34 |
| 35 // Check if the user inputs in the SyntheticPointerActionParams can generate | 35 // Check if the user inputs in the SyntheticPointerActionParams can generate |
| 36 // a valid sequence of pointer actions. | 36 // a valid sequence of pointer actions. |
| 37 virtual bool UserInputCheck( | 37 virtual bool UserInputCheck( |
| 38 const SyntheticPointerActionParams& params) const = 0; | 38 const SyntheticPointerActionParams& params) const = 0; |
| 39 | 39 |
| 40 protected: | 40 protected: |
| 41 static double ConvertTimestampToSeconds(const base::TimeTicks& timestamp); | 41 static double ConvertTimestampToSeconds(const base::TimeTicks& timestamp); |
| 42 | 42 |
| 43 private: | 43 private: |
| 44 DISALLOW_COPY_AND_ASSIGN(SyntheticPointerDriver); | 44 DISALLOW_COPY_AND_ASSIGN(SyntheticPointerDriver); |
| 45 }; | 45 }; |
| 46 | 46 |
| 47 } // namespace content | 47 } // namespace content |
| 48 | 48 |
| 49 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_SYNTHETIC_POINTER_DRIVER_H_ | 49 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_SYNTHETIC_POINTER_DRIVER_H_ |
| OLD | NEW |