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

Unified Diff: content/browser/renderer_host/input/synthetic_smooth_scroll_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 side-by-side diff with in-line comments
Download patch
Index: content/browser/renderer_host/input/synthetic_smooth_scroll_gesture.h
diff --git a/content/browser/renderer_host/input/synthetic_smooth_scroll_gesture.h b/content/browser/renderer_host/input/synthetic_smooth_scroll_gesture.h
index 53b4da54683ecdf306cb7e860346a632da5d8f7d..b598a18e730a5baaac3051a7209220c728efc4ad 100644
--- a/content/browser/renderer_host/input/synthetic_smooth_scroll_gesture.h
+++ b/content/browser/renderer_host/input/synthetic_smooth_scroll_gesture.h
@@ -24,7 +24,8 @@ class CONTENT_EXPORT SyntheticSmoothScrollGesture : public SyntheticGesture {
virtual ~SyntheticSmoothScrollGesture();
virtual SyntheticGesture::Result ForwardInputEvents(
- const base::TimeDelta& interval, SyntheticGestureTarget* target) OVERRIDE;
+ const base::TimeTicks& timestamp,
+ SyntheticGestureTarget* target) OVERRIDE;
private:
enum GestureState {
@@ -36,31 +37,39 @@ class CONTENT_EXPORT SyntheticSmoothScrollGesture : public SyntheticGesture {
};
void ForwardTouchInputEvents(
- const base::TimeDelta& interval, SyntheticGestureTarget* target);
+ const base::TimeTicks& timestamp, SyntheticGestureTarget* target);
void ForwardMouseInputEvents(
- const base::TimeDelta& interval, SyntheticGestureTarget* target);
+ const base::TimeTicks& timestamp, SyntheticGestureTarget* target);
- void ForwardTouchEvent(SyntheticGestureTarget* target) const;
+ void ForwardTouchEvent(SyntheticGestureTarget* target,
+ const base::TimeTicks& timestamp);
void ForwardMouseWheelEvent(SyntheticGestureTarget* target,
- const gfx::Vector2dF& delta) const;
+ const gfx::Vector2dF& delta,
+ const base::TimeTicks& timestamp) const;
- void PressTouchPoint(SyntheticGestureTarget* target);
- void MoveTouchPoint(SyntheticGestureTarget* target);
- void ReleaseTouchPoint(SyntheticGestureTarget* target);
+ void PressTouchPoint(SyntheticGestureTarget* target,
+ const base::TimeTicks& timestamp);
+ void MoveTouchPoint(SyntheticGestureTarget* target,
+ const gfx::Vector2dF& delta,
+ const base::TimeTicks& timestamp);
+ void ReleaseTouchPoint(SyntheticGestureTarget* target,
+ const base::TimeTicks& timestamp);
void AddTouchSlopToDistance(SyntheticGestureTarget* target);
- gfx::Vector2dF GetPositionDelta(const base::TimeDelta& interval) const;
+ gfx::Vector2dF GetPositionDeltaAtTime(const base::TimeTicks& timestamp)
+ const;
gfx::Vector2dF ProjectLengthOntoScrollDirection(float delta_length) const;
- gfx::Vector2dF ComputeRemainingDelta() const;
- bool HasScrolledEntireDistance() const;
+ void ComputeAndSetStopScrollingTime();
+ base::TimeTicks ClampTimestamp(const base::TimeTicks& timestamp) const;
+ bool HasScrolledEntireDistance(const base::TimeTicks& timestamp) const;
SyntheticSmoothScrollGestureParams params_;
- gfx::Vector2dF total_delta_;
gfx::Vector2d total_delta_discrete_;
SyntheticWebTouchEvent touch_event_;
SyntheticGestureParams::GestureSourceType gesture_source_type_;
GestureState state_;
- base::TimeDelta total_stopping_wait_time_;
+ base::TimeTicks start_time_;
+ base::TimeTicks stop_scrolling_time_;
DISALLOW_COPY_AND_ASSIGN(SyntheticSmoothScrollGesture);
};

Powered by Google App Engine
This is Rietveld 408576698