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

Side by Side Diff: content/port/browser/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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "content/port/browser/smooth_scroll_gesture.h"
6
7 namespace content {
8
9 double SmoothScrollGesture::Tick(
10 base::TimeTicks now, double desired_interval_ms) {
11 double position_delta = 10;
12 if (!last_tick_time_.is_null()) {
13 double velocity = 10 / desired_interval_ms;
14 double time_delta = (now - last_tick_time_).InMillisecondsF();
15 position_delta = velocity * time_delta;
16 }
17
18 last_tick_time_ = now;
19 return position_delta;
20 }
21
22 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698