Commit 333f3812 authored by nduca@chromium.org's avatar nduca@chromium.org

beginSmoothScroll tries to do a simple animation for a given length in...

beginSmoothScroll tries to do a simple animation for a given length in seconds, specified as a double. To do a half-second animation, it did base::TimeDelta::FromSeconds(0.5). base::TimeDelta::FromSeconds takes an in64, so this silently converts to FromSeconds(0) causing the smooth scroll to do exactly one step and stop.

Review URL: https://chromiumcodereview.appspot.com/10825407

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@152186 0039d316-1c4b-4281-b951-d872f2087c98
parent f09fb856
......@@ -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 int64 kDurationOfNearScrollGestureMs = 150;
// How long a smooth scroll gesture should run when it is a far scroll.
static const double kDurationOfFarScrollGestureSec = 0.5;
static const int64 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;
int64 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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment