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

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

Issue 1349813002: Enable pinch-zoom telemetry on Mac (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@telemetry
Patch Set: fix test macro issue Created 5 years, 3 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
jdduke (slow) 2015/09/22 18:52:37 For moved files do we update the copyright year? I
ericrk 2015/09/22 21:46:26 The only thing I see in our c++ guidelines is "The
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_PINCH_GESTURE_H_ 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_INPUT_synthetic_touchscreen_pinch_gesture_ H_
jdduke (slow) 2015/09/22 18:52:37 Nit: Uppercase.
ericrk 2015/09/22 21:46:26 Done.
6 #define CONTENT_BROWSER_RENDERER_HOST_INPUT_SYNTHETIC_PINCH_GESTURE_H_ 6 #define CONTENT_BROWSER_RENDERER_HOST_INPUT_synthetic_touchscreen_pinch_gesture_ H_
7 7
8 #include "base/time/time.h" 8 #include "base/time/time.h"
9 #include "content/browser/renderer_host/input/synthetic_gesture.h" 9 #include "content/browser/renderer_host/input/synthetic_gesture.h"
10 #include "content/browser/renderer_host/input/synthetic_gesture_target.h" 10 #include "content/browser/renderer_host/input/synthetic_gesture_target.h"
11 #include "content/common/content_export.h" 11 #include "content/common/content_export.h"
12 #include "content/common/input/synthetic_pinch_gesture_params.h" 12 #include "content/common/input/synthetic_pinch_gesture_params.h"
13 #include "content/common/input/synthetic_web_input_event_builders.h" 13 #include "content/common/input/synthetic_web_input_event_builders.h"
14 #include "third_party/WebKit/public/web/WebInputEvent.h" 14 #include "third_party/WebKit/public/web/WebInputEvent.h"
15 15
16 namespace content { 16 namespace content {
17 17
18 class CONTENT_EXPORT SyntheticPinchGesture : public SyntheticGesture { 18 class CONTENT_EXPORT SyntheticTouchscreenPinchGesture
19 : public SyntheticGesture {
19 public: 20 public:
20 explicit SyntheticPinchGesture(const SyntheticPinchGestureParams& params); 21 explicit SyntheticTouchscreenPinchGesture(
21 ~SyntheticPinchGesture() override; 22 const SyntheticPinchGestureParams& params);
23 ~SyntheticTouchscreenPinchGesture() override;
22 24
23 SyntheticGesture::Result ForwardInputEvents( 25 SyntheticGesture::Result ForwardInputEvents(
24 const base::TimeTicks& timestamp, 26 const base::TimeTicks& timestamp,
25 SyntheticGestureTarget* target) override; 27 SyntheticGestureTarget* target) override;
26 28
27 private: 29 private:
28 enum GestureState { 30 enum GestureState { SETUP, STARTED, MOVING, DONE };
29 SETUP,
30 STARTED,
31 MOVING,
32 DONE
33 };
34 31
35 void ForwardTouchInputEvents(const base::TimeTicks& timestamp, 32 void ForwardTouchInputEvents(const base::TimeTicks& timestamp,
36 SyntheticGestureTarget* target); 33 SyntheticGestureTarget* target);
37 34
38 void UpdateTouchPoints(const base::TimeTicks& timestamp); 35 void UpdateTouchPoints(const base::TimeTicks& timestamp);
39 void PressTouchPoints(SyntheticGestureTarget* target, 36 void PressTouchPoints(SyntheticGestureTarget* target,
40 const base::TimeTicks& timestamp); 37 const base::TimeTicks& timestamp);
41 void MoveTouchPoints(SyntheticGestureTarget* target, float delta, 38 void MoveTouchPoints(SyntheticGestureTarget* target,
39 float delta,
42 const base::TimeTicks& timestamp); 40 const base::TimeTicks& timestamp);
43 void ReleaseTouchPoints(SyntheticGestureTarget* target, 41 void ReleaseTouchPoints(SyntheticGestureTarget* target,
44 const base::TimeTicks& timestamp); 42 const base::TimeTicks& timestamp);
45 void ForwardTouchEvent(SyntheticGestureTarget* target, 43 void ForwardTouchEvent(SyntheticGestureTarget* target,
46 const base::TimeTicks& timestamp); 44 const base::TimeTicks& timestamp);
47 45
48 void SetupCoordinatesAndStopTime(SyntheticGestureTarget* target); 46 void SetupCoordinatesAndStopTime(SyntheticGestureTarget* target);
49 float GetDeltaForPointer0AtTime(const base::TimeTicks& timestamp) const; 47 float GetDeltaForPointer0AtTime(const base::TimeTicks& timestamp) const;
50 base::TimeTicks ClampTimestamp(const base::TimeTicks& timestamp) const; 48 base::TimeTicks ClampTimestamp(const base::TimeTicks& timestamp) const;
51 bool HasReachedTarget(const base::TimeTicks& timestamp) const; 49 bool HasReachedTarget(const base::TimeTicks& timestamp) const;
52 50
53 SyntheticPinchGestureParams params_; 51 SyntheticPinchGestureParams params_;
54 float start_y_0_; 52 float start_y_0_;
55 float start_y_1_; 53 float start_y_1_;
56 float max_pointer_delta_0_; 54 float max_pointer_delta_0_;
57 SyntheticGestureParams::GestureSourceType gesture_source_type_; 55 SyntheticGestureParams::GestureSourceType gesture_source_type_;
58 GestureState state_; 56 GestureState state_;
59 SyntheticWebTouchEvent touch_event_; 57 SyntheticWebTouchEvent touch_event_;
60 base::TimeTicks start_time_; 58 base::TimeTicks start_time_;
61 base::TimeTicks stop_time_; 59 base::TimeTicks stop_time_;
62 60
63 private: 61 private:
64 DISALLOW_COPY_AND_ASSIGN(SyntheticPinchGesture); 62 DISALLOW_COPY_AND_ASSIGN(SyntheticTouchscreenPinchGesture);
65 }; 63 };
66 64
67 } // namespace content 65 } // namespace content
68 66
69 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_SYNTHETIC_PINCH_GESTURE_H_ 67 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_synthetic_touchscreen_pinch_gestu re_H_
jdduke (slow) 2015/09/22 18:52:37 Uppercase
ericrk 2015/09/22 21:46:26 Done.
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698