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

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

Issue 10825407: Fix beginSmoothScroll by doing duration computation in ms (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 4 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/render_widget_host_view_base.cc
diff --git a/content/browser/renderer_host/render_widget_host_view_base.cc b/content/browser/renderer_host/render_widget_host_view_base.cc
index afcc2b9bd4b7dbac54450408d8364ffd5a80fb71..9fcc642a6a13ab19458d69558fd1f16c223d1cc1 100644
--- a/content/browser/renderer_host/render_widget_host_view_base.cc
+++ b/content/browser/renderer_host/render_widget_host_view_base.cc
@@ -22,10 +22,10 @@
namespace content {
// How long a smooth scroll gesture should run when it is a near scroll.
-static const double kDurationOfNearScrollGestureSec = 0.15;
+static const double kDurationOfNearScrollGestureMs = 150;
piman 2012/08/17 19:28:28 Actually, should those be int64s, since that's wha
// How long a smooth scroll gesture should run when it is a far scroll.
-static const double kDurationOfFarScrollGestureSec = 0.5;
+static const double kDurationOfFarScrollGestureMs = 500;
// static
RenderWidgetHostViewPort* RenderWidgetHostViewPort::FromRWHV(
@@ -130,13 +130,13 @@ class BasicMouseWheelSmoothScrollGesture
virtual bool ForwardInputEvents(base::TimeTicks now,
RenderWidgetHost* host) OVERRIDE {
- double duration_in_seconds;
+ double duration_in_ms;
if (scroll_far_)
- duration_in_seconds = kDurationOfFarScrollGestureSec;
+ duration_in_ms = kDurationOfFarScrollGestureMs;
else
- duration_in_seconds = kDurationOfNearScrollGestureSec;
+ duration_in_ms = kDurationOfNearScrollGestureMs;
- if (now - start_time_ > base::TimeDelta::FromSeconds(duration_in_seconds))
+ if (now - start_time_ > base::TimeDelta::FromMilliseconds(duration_in_ms))
return false;
WebKit::WebMouseWheelEvent event;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698