Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(56)

Side by Side Diff: content/browser/renderer_host/input/synthetic_tap_gesture.h

Issue 119323007: Add timestamps to synthesized events. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove target variables in pinch; fix computation of total duration. Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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_TAP_GESTURE_H_ 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_INPUT_SYNTHETIC_TAP_GESTURE_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_INPUT_SYNTHETIC_TAP_GESTURE_H_ 6 #define CONTENT_BROWSER_RENDERER_HOST_INPUT_SYNTHETIC_TAP_GESTURE_H_
7 7
8 #include "content/browser/renderer_host/input/synthetic_gesture.h" 8 #include "content/browser/renderer_host/input/synthetic_gesture.h"
9 #include "content/browser/renderer_host/input/synthetic_gesture_target.h" 9 #include "content/browser/renderer_host/input/synthetic_gesture_target.h"
10 #include "content/common/content_export.h" 10 #include "content/common/content_export.h"
11 #include "content/common/input/synthetic_tap_gesture_params.h" 11 #include "content/common/input/synthetic_tap_gesture_params.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 namespace content { 14 namespace content {
15 15
16 class CONTENT_EXPORT SyntheticTapGesture : public SyntheticGesture { 16 class CONTENT_EXPORT SyntheticTapGesture : public SyntheticGesture {
17 public: 17 public:
18 explicit SyntheticTapGesture(const SyntheticTapGestureParams& params); 18 explicit SyntheticTapGesture(const SyntheticTapGestureParams& params);
19 virtual ~SyntheticTapGesture(); 19 virtual ~SyntheticTapGesture();
20 20
21 virtual SyntheticGesture::Result ForwardInputEvents( 21 virtual SyntheticGesture::Result ForwardInputEvents(
22 const base::TimeDelta& interval, SyntheticGestureTarget* target) OVERRIDE; 22 const base::TimeTicks& timestamp,
23 SyntheticGestureTarget* target) OVERRIDE;
23 24
24 private: 25 private:
25 enum GestureState { 26 enum GestureState {
26 SETUP, 27 SETUP,
27 PRESS, 28 PRESS,
28 WAITING_TO_RELEASE, 29 WAITING_TO_RELEASE,
29 DONE 30 DONE
30 }; 31 };
31 32
32 void ForwardTouchOrMouseInputEvents(const base::TimeDelta& interval, 33 void ForwardTouchOrMouseInputEvents(const base::TimeTicks& timestamp,
33 SyntheticGestureTarget* target); 34 SyntheticGestureTarget* target);
34 35
35 void Press(SyntheticGestureTarget* target); 36 void Press(SyntheticGestureTarget* target, const base::TimeTicks& timestamp);
36 void Release(SyntheticGestureTarget* target); 37 void Release(SyntheticGestureTarget* target,
38 const base::TimeTicks& timestamp);
39
40 base::TimeDelta GetDuration() const;
37 41
38 SyntheticTapGestureParams params_; 42 SyntheticTapGestureParams params_;
39 base::TimeDelta total_waiting_time_; 43 base::TimeTicks start_time_;
40 SyntheticWebTouchEvent touch_event_; 44 SyntheticWebTouchEvent touch_event_;
41 SyntheticGestureParams::GestureSourceType gesture_source_type_; 45 SyntheticGestureParams::GestureSourceType gesture_source_type_;
42 GestureState state_; 46 GestureState state_;
43 47
44 DISALLOW_COPY_AND_ASSIGN(SyntheticTapGesture); 48 DISALLOW_COPY_AND_ASSIGN(SyntheticTapGesture);
45 }; 49 };
46 50
47 } // namespace content 51 } // namespace content
48 52
49 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_SYNTHETIC_TAP_GESTURE_H_ 53 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_SYNTHETIC_TAP_GESTURE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698