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_BROWSER_RENDERER_HOST_INPUT_SYNTHETIC_GESTURE_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_INPUT_SYNTHETIC_GESTURE_H_ |
6 #define CONTENT_BROWSER_RENDERER_HOST_INPUT_SYNTHETIC_GESTURE_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_INPUT_SYNTHETIC_GESTURE_H_ |
7 | 7 |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/time/time.h" | 9 #include "base/time/time.h" |
10 #include "content/common/content_export.h" | 10 #include "content/common/content_export.h" |
(...skipping 28 matching lines...) Expand all Loading... |
39 GESTURE_FINISHED, | 39 GESTURE_FINISHED, |
40 GESTURE_SOURCE_TYPE_NOT_IMPLEMENTED, | 40 GESTURE_SOURCE_TYPE_NOT_IMPLEMENTED, |
41 GESTURE_SOURCE_TYPE_NOT_SUPPORTED_BY_PLATFORM, | 41 GESTURE_SOURCE_TYPE_NOT_SUPPORTED_BY_PLATFORM, |
42 GESTURE_RESULT_MAX = GESTURE_SOURCE_TYPE_NOT_SUPPORTED_BY_PLATFORM | 42 GESTURE_RESULT_MAX = GESTURE_SOURCE_TYPE_NOT_SUPPORTED_BY_PLATFORM |
43 }; | 43 }; |
44 | 44 |
45 // Update the state of the gesture and forward the appropriate events to the | 45 // Update the state of the gesture and forward the appropriate events to the |
46 // platform. This function is called repeatedly by the synthetic gesture | 46 // platform. This function is called repeatedly by the synthetic gesture |
47 // controller until it stops returning GESTURE_RUNNING. | 47 // controller until it stops returning GESTURE_RUNNING. |
48 virtual Result ForwardInputEvents( | 48 virtual Result ForwardInputEvents( |
49 const base::TimeDelta& interval, SyntheticGestureTarget* target) = 0; | 49 const base::TimeTicks& timestamp, SyntheticGestureTarget* target) = 0; |
50 | 50 |
51 private: | 51 protected: |
| 52 static double ConvertTimestampToSeconds(const base::TimeTicks& timestamp); |
| 53 |
52 DISALLOW_COPY_AND_ASSIGN(SyntheticGesture); | 54 DISALLOW_COPY_AND_ASSIGN(SyntheticGesture); |
53 }; | 55 }; |
54 | 56 |
55 } // namespace content | 57 } // namespace content |
56 | 58 |
57 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_SYNTHETIC_GESTURE_H_ | 59 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_SYNTHETIC_GESTURE_H_ |
OLD | NEW |