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

Unified Diff: content/browser/renderer_host/basic_mouse_wheel_smooth_scroll_gesture.cc

Issue 11793003: Relands: Telemetry: hooks "chrome.gpuBenchmarking.smoothScrollBy" with java on android. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nits Created 7 years, 7 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/basic_mouse_wheel_smooth_scroll_gesture.cc
diff --git a/content/browser/renderer_host/basic_mouse_wheel_smooth_scroll_gesture.cc b/content/browser/renderer_host/basic_mouse_wheel_smooth_scroll_gesture.cc
index b4eaa497fd7a97abd8588e0b7f1e43a23e2e668c..1bcc8223e97e1c78a74d4e34f8ddf56838a01b44 100644
--- a/content/browser/renderer_host/basic_mouse_wheel_smooth_scroll_gesture.cc
+++ b/content/browser/renderer_host/basic_mouse_wheel_smooth_scroll_gesture.cc
@@ -26,17 +26,10 @@ bool BasicMouseWheelSmoothScrollGesture::ForwardInputEvents(
if (pixels_scrolled_ >= pixels_to_scroll_)
return false;
- double position_delta = 10;
- if (!last_tick_time_.is_null()) {
- RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From(host);
- base::TimeDelta desired_interval =
- rwhi->GetSyntheticScrollMessageInterval();
- double velocity = 10 / desired_interval.InMillisecondsF();
- double time_delta = (now - last_tick_time_).InMillisecondsF();
- position_delta = velocity * time_delta;
- }
-
- last_tick_time_ = now;
+ double position_delta = smooth_scroll_calculator_.GetScrollDelta(
+ now,
+ RenderWidgetHostImpl::From(host)->GetSyntheticScrollMessageInterval());
+
WebKit::WebMouseWheelEvent event;
event.type = WebKit::WebInputEvent::MouseWheel;

Powered by Google App Engine
This is Rietveld 408576698