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

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

Issue 1349813002: Enable pinch-zoom telemetry on Mac (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@telemetry
Patch Set: feedback Created 5 years, 2 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CONTENT_BROWSER_RENDERER_HOST_INPUT_SYNTHETIC_TOUCHPAD_PINCH_GESTURE_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_INPUT_SYNTHETIC_TOUCHPAD_PINCH_GESTURE_H_
7
8 #include "base/time/time.h"
9 #include "content/browser/renderer_host/input/synthetic_gesture.h"
10 #include "content/browser/renderer_host/input/synthetic_gesture_target.h"
11 #include "content/common/content_export.h"
12 #include "content/common/input/synthetic_pinch_gesture_params.h"
13 #include "content/common/input/synthetic_web_input_event_builders.h"
14 #include "third_party/WebKit/public/web/WebInputEvent.h"
15
16 namespace content {
17
18 class CONTENT_EXPORT SyntheticTouchpadPinchGesture : public SyntheticGesture {
19 public:
20 explicit SyntheticTouchpadPinchGesture(
21 const SyntheticPinchGestureParams& params);
22 ~SyntheticTouchpadPinchGesture() override;
23
24 SyntheticGesture::Result ForwardInputEvents(
25 const base::TimeTicks& timestamp,
26 SyntheticGestureTarget* target) override;
27
28 private:
29 enum GestureState { SETUP, STARTED, IN_PROGRESS, DONE };
30
31 void ForwardGestureEvents(const base::TimeTicks& timestamp,
32 SyntheticGestureTarget* target);
33
34 void UpdateTouchPoints(const base::TimeTicks& timestamp);
35
36 void CalculateEndTime(SyntheticGestureTarget* target);
37 float CalculateTargetScale(const base::TimeTicks& timestamp) const;
38 base::TimeTicks ClampTimestamp(const base::TimeTicks& timestamp) const;
39 bool HasReachedTarget(const base::TimeTicks& timestamp) const;
40
41 SyntheticPinchGestureParams params_;
42 SyntheticGestureParams::GestureSourceType gesture_source_type_;
43 GestureState state_;
44 base::TimeTicks start_time_;
45 base::TimeTicks stop_time_;
46 float current_scale_;
47
48 private:
49 DISALLOW_COPY_AND_ASSIGN(SyntheticTouchpadPinchGesture);
50 };
51
52 } // namespace content
53
54 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_SYNTHETIC_TOUCHPAD_PINCH_GESTURE_ H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698