| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_COMMON_INPUT_SYNTHETIC_WEB_INPUT_EVENT_BUILDERS_H_ | 5 #ifndef CONTENT_COMMON_INPUT_SYNTHETIC_WEB_INPUT_EVENT_BUILDERS_H_ |
| 6 #define CONTENT_COMMON_INPUT_SYNTHETIC_WEB_INPUT_EVENT_BUILDERS_H_ | 6 #define CONTENT_COMMON_INPUT_SYNTHETIC_WEB_INPUT_EVENT_BUILDERS_H_ |
| 7 | 7 |
| 8 #include "base/time/time.h" | 8 #include "base/time/time.h" |
| 9 #include "content/common/content_export.h" | 9 #include "content/common/content_export.h" |
| 10 #include "third_party/WebKit/public/web/WebInputEvent.h" | 10 #include "third_party/WebKit/public/web/WebInputEvent.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 | 34 |
| 35 class CONTENT_EXPORT SyntheticWebKeyboardEventBuilder { | 35 class CONTENT_EXPORT SyntheticWebKeyboardEventBuilder { |
| 36 public: | 36 public: |
| 37 static blink::WebKeyboardEvent Build(blink::WebInputEvent::Type type); | 37 static blink::WebKeyboardEvent Build(blink::WebInputEvent::Type type); |
| 38 }; | 38 }; |
| 39 | 39 |
| 40 class CONTENT_EXPORT SyntheticWebGestureEventBuilder { | 40 class CONTENT_EXPORT SyntheticWebGestureEventBuilder { |
| 41 public: | 41 public: |
| 42 static blink::WebGestureEvent Build( | 42 static blink::WebGestureEvent Build( |
| 43 blink::WebInputEvent::Type type, | 43 blink::WebInputEvent::Type type, |
| 44 blink::WebGestureEvent::SourceDevice sourceDevice); | 44 blink::WebGestureEvent::SourceDevice source_device); |
| 45 static blink::WebGestureEvent BuildScrollBegin(float dx_hint, | 45 static blink::WebGestureEvent BuildScrollBegin(float dx_hint, |
| 46 float dy_hint); | 46 float dy_hint); |
| 47 static blink::WebGestureEvent BuildScrollUpdate(float dx, | 47 static blink::WebGestureEvent BuildScrollUpdate(float dx, |
| 48 float dy, | 48 float dy, |
| 49 int modifiers); | 49 int modifiers); |
| 50 static blink::WebGestureEvent BuildPinchUpdate(float scale, | 50 static blink::WebGestureEvent BuildPinchUpdate( |
| 51 float anchor_x, | 51 float scale, |
| 52 float anchor_y, | 52 float anchor_x, |
| 53 int modifiers); | 53 float anchor_y, |
| 54 int modifiers, |
| 55 blink::WebGestureEvent::SourceDevice source_device); |
| 54 static blink::WebGestureEvent BuildFling( | 56 static blink::WebGestureEvent BuildFling( |
| 55 float velocity_x, | 57 float velocity_x, |
| 56 float velocity_y, | 58 float velocity_y, |
| 57 blink::WebGestureEvent::SourceDevice source_device); | 59 blink::WebGestureEvent::SourceDevice source_device); |
| 58 }; | 60 }; |
| 59 | 61 |
| 60 class CONTENT_EXPORT SyntheticWebTouchEvent | 62 class CONTENT_EXPORT SyntheticWebTouchEvent |
| 61 : public NON_EXPORTED_BASE(blink::WebTouchEvent) { | 63 : public NON_EXPORTED_BASE(blink::WebTouchEvent) { |
| 62 public: | 64 public: |
| 63 SyntheticWebTouchEvent(); | 65 SyntheticWebTouchEvent(); |
| 64 | 66 |
| 65 // Mark all the points as stationary, and remove any released points. | 67 // Mark all the points as stationary, and remove any released points. |
| 66 void ResetPoints(); | 68 void ResetPoints(); |
| 67 | 69 |
| 68 // Adds an additional point to the touch list, returning the point's index. | 70 // Adds an additional point to the touch list, returning the point's index. |
| 69 int PressPoint(float x, float y); | 71 int PressPoint(float x, float y); |
| 70 void MovePoint(int index, float x, float y); | 72 void MovePoint(int index, float x, float y); |
| 71 void ReleasePoint(int index); | 73 void ReleasePoint(int index); |
| 72 void CancelPoint(int index); | 74 void CancelPoint(int index); |
| 73 | 75 |
| 74 void SetTimestamp(base::TimeDelta timestamp); | 76 void SetTimestamp(base::TimeDelta timestamp); |
| 75 }; | 77 }; |
| 76 | 78 |
| 77 } // namespace content | 79 } // namespace content |
| 78 | 80 |
| 79 #endif // CONTENT_COMMON_INPUT_SYNTHETIC_WEB_INPUT_EVENT_BUILDERS_H_ | 81 #endif // CONTENT_COMMON_INPUT_SYNTHETIC_WEB_INPUT_EVENT_BUILDERS_H_ |
| OLD | NEW |