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

Unified Diff: content/browser/renderer_host/input/synthetic_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, 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/renderer_host/input/synthetic_pinch_gesture.h
diff --git a/content/browser/renderer_host/input/synthetic_pinch_gesture.h b/content/browser/renderer_host/input/synthetic_pinch_gesture.h
index 71e79ec6b2b82972b944ded99ba07773b4aecdfb..e0444438244771626dff9c4dcd42fe0df92c9609 100644
--- a/content/browser/renderer_host/input/synthetic_pinch_gesture.h
+++ b/content/browser/renderer_host/input/synthetic_pinch_gesture.h
@@ -1,4 +1,4 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
+// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -10,11 +10,13 @@
#include "content/browser/renderer_host/input/synthetic_gesture_target.h"
#include "content/common/content_export.h"
#include "content/common/input/synthetic_pinch_gesture_params.h"
-#include "content/common/input/synthetic_web_input_event_builders.h"
-#include "third_party/WebKit/public/web/WebInputEvent.h"
namespace content {
+// SyntheticPinchGesture is a thin wrapper around either
+// SyntheticTouchscreenPinchGesture or SyntheticTouchpadPinchGesture, depending
+// on the SyntheticGestureParam's |input_type| and the default input type of the
+// target.
class CONTENT_EXPORT SyntheticPinchGesture : public SyntheticGesture {
public:
explicit SyntheticPinchGesture(const SyntheticPinchGestureParams& params);
@@ -25,42 +27,9 @@ class CONTENT_EXPORT SyntheticPinchGesture : public SyntheticGesture {
SyntheticGestureTarget* target) override;
private:
- enum GestureState {
- SETUP,
- STARTED,
- MOVING,
- DONE
- };
-
- void ForwardTouchInputEvents(const base::TimeTicks& timestamp,
- SyntheticGestureTarget* target);
-
- void UpdateTouchPoints(const base::TimeTicks& timestamp);
- void PressTouchPoints(SyntheticGestureTarget* target,
- const base::TimeTicks& timestamp);
- void MoveTouchPoints(SyntheticGestureTarget* target, float delta,
- const base::TimeTicks& timestamp);
- void ReleaseTouchPoints(SyntheticGestureTarget* target,
- const base::TimeTicks& timestamp);
- void ForwardTouchEvent(SyntheticGestureTarget* target,
- const base::TimeTicks& timestamp);
-
- void SetupCoordinatesAndStopTime(SyntheticGestureTarget* target);
- float GetDeltaForPointer0AtTime(const base::TimeTicks& timestamp) const;
- base::TimeTicks ClampTimestamp(const base::TimeTicks& timestamp) const;
- bool HasReachedTarget(const base::TimeTicks& timestamp) const;
-
SyntheticPinchGestureParams params_;
- float start_y_0_;
- float start_y_1_;
- float max_pointer_delta_0_;
- SyntheticGestureParams::GestureSourceType gesture_source_type_;
- GestureState state_;
- SyntheticWebTouchEvent touch_event_;
- base::TimeTicks start_time_;
- base::TimeTicks stop_time_;
+ scoped_ptr<SyntheticGesture> lazy_gesture_;
- private:
DISALLOW_COPY_AND_ASSIGN(SyntheticPinchGesture);
};

Powered by Google App Engine
This is Rietveld 408576698