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

Unified Diff: content/browser/renderer_host/input/synthetic_pinch_gesture.h

Issue 95153002: Make touch-based synthetic gesture take touch slop into account. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Minor refactoring of pinch gesture. Created 7 years 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 e8cdebfc6e75e10240f4122bc0f6de0ec232a891..d5c17bcf467c9f657214a65efed2709859252bcb 100644
--- a/content/browser/renderer_host/input/synthetic_pinch_gesture.h
+++ b/content/browser/renderer_host/input/synthetic_pinch_gesture.h
@@ -23,22 +23,36 @@ class CONTENT_EXPORT SyntheticPinchGesture : public SyntheticGesture {
const base::TimeDelta& interval, SyntheticGestureTarget* target) OVERRIDE;
private:
+ enum GestureState {
+ SETUP,
+ STARTED,
+ MOVING,
+ DONE
+ };
+
+ void ForwardTouchInputEvents(
+ const base::TimeDelta& interval, SyntheticGestureTarget* target);
+
+ void UpdateTouchPoints(base::TimeDelta interval);
+ void PressTouchPoints(SyntheticGestureTarget* target);
+ void MoveTouchPoints(SyntheticGestureTarget* target);
+ void ReleaseTouchPoints(SyntheticGestureTarget* target);
+ void ForwardTouchEvent(SyntheticGestureTarget* target) const;
+
+ void SetupCoordinates(SyntheticGestureTarget* target);
+
+ float GetDeltaForPointer0(const base::TimeDelta& interval) const;
+ float ComputeAbsoluteRemainingDistance() const;
+ bool HasReachedTarget() const;
+
SyntheticPinchGestureParams params_;
float current_y_0_;
float current_y_1_;
float target_y_0_;
float target_y_1_;
- bool started_;
SyntheticWebTouchEvent touch_event_;
-
- SyntheticGesture::Result ForwardTouchInputEvents(
- const base::TimeDelta& interval, SyntheticGestureTarget* target);
-
- void ForwardTouchEvent(SyntheticGestureTarget* target);
-
- float GetDeltaForPointer0(const base::TimeDelta& interval) const;
- float ComputeAbsoluteRemainingDistance() const;
- bool HasFinished() const;
+ SyntheticGestureParams::GestureSourceType gesture_source_type_;
+ GestureState state_;
DISALLOW_COPY_AND_ASSIGN(SyntheticPinchGesture);
};

Powered by Google App Engine
This is Rietveld 408576698