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

Unified Diff: content/browser/renderer_host/input/synthetic_gesture_controller.cc

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_gesture_controller.cc
diff --git a/content/browser/renderer_host/input/synthetic_gesture_controller.cc b/content/browser/renderer_host/input/synthetic_gesture_controller.cc
index 0529354ac38237b56a006f17d5e226a62ed850ca..fe399878636cc63a6a229bd2bdaa3da7e611de70 100644
--- a/content/browser/renderer_host/input/synthetic_gesture_controller.cc
+++ b/content/browser/renderer_host/input/synthetic_gesture_controller.cc
@@ -33,16 +33,8 @@ void SyntheticGestureController::Flush(base::TimeTicks timestamp) {
if (pending_gesture_queue_.empty())
return;
- if (last_tick_time_.is_null()) {
- last_tick_time_ = timestamp;
- gesture_target_->SetNeedsFlush();
- return;
- }
-
- base::TimeDelta interval = timestamp - last_tick_time_;
- last_tick_time_ = timestamp;
SyntheticGesture::Result result =
- pending_gesture_queue_.front()->ForwardInputEvents(interval,
+ pending_gesture_queue_.front()->ForwardInputEvents(timestamp,
gesture_target_.get());
if (result == SyntheticGesture::GESTURE_RUNNING) {
@@ -53,13 +45,8 @@ void SyntheticGestureController::Flush(base::TimeTicks timestamp) {
StopGesture(*pending_gesture_queue_.front(), result);
pending_gesture_queue_.erase(pending_gesture_queue_.begin());
- if (!pending_gesture_queue_.empty()) {
+ if (!pending_gesture_queue_.empty())
StartGesture(*pending_gesture_queue_.front());
- } else {
- // Reset last_tick_time_ so that we don't use an old value when a new
- // gestures is queued.
- last_tick_time_ = base::TimeTicks();
- }
}
void SyntheticGestureController::StartGesture(const SyntheticGesture& gesture) {

Powered by Google App Engine
This is Rietveld 408576698