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

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

Issue 11415227: Telemtry: hooks "chrome.gpuBenchmarking.smoothScrollBy" with java on android. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove inline virtual dtor Created 8 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/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 af93b7ca05a3bf3971f54672cd016365f2fcd1d1..6740c448d54c75f2e8fac85ed90f97e8382a479b 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,21 +26,13 @@ bool BasicMouseWheelSmoothScrollGesture::ForwardInputEvents(
if (pixels_scrolled_ >= pixels_to_scroll_)
return false;
- double positionDelta = 10;
- if (!last_tick_time_.is_null()) {
- RenderWidgetHostImpl* hostImpl = RenderWidgetHostImpl::From(host);
- double desiredIntervalMs = hostImpl->SyntheticScrollMessageInterval();
- double velocity = 10 / desiredIntervalMs;
- double timeDelta = (now - last_tick_time_).InMillisecondsF();
- positionDelta = velocity * timeDelta;
- }
-
- last_tick_time_ = now;
+ double position_delta = Tick(
+ now, RenderWidgetHostImpl::From(host)->SyntheticScrollMessageInterval());
WebKit::WebMouseWheelEvent event;
event.type = WebKit::WebInputEvent::MouseWheel;
event.hasPreciseScrollingDeltas = 1;
- event.deltaY = scroll_down_ ? -positionDelta : positionDelta;
+ event.deltaY = scroll_down_ ? -position_delta : position_delta;
// TODO(vollick): find a proper way to access
// WebCore::WheelEvent::tickMultiplier.
event.wheelTicksY = event.deltaY / 120;

Powered by Google App Engine
This is Rietveld 408576698