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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: content/port/browser/smooth_scroll_gesture.cc
diff --git a/content/port/browser/smooth_scroll_gesture.cc b/content/port/browser/smooth_scroll_gesture.cc
new file mode 100644
index 0000000000000000000000000000000000000000..b783fc0a75cdd4fdaa995d058e5bc51c84c718a3
--- /dev/null
+++ b/content/port/browser/smooth_scroll_gesture.cc
@@ -0,0 +1,22 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "content/port/browser/smooth_scroll_gesture.h"
+
+namespace content {
+
+double SmoothScrollGesture::Tick(
+ base::TimeTicks now, double desired_interval_ms) {
+ double position_delta = 10;
+ if (!last_tick_time_.is_null()) {
+ double velocity = 10 / desired_interval_ms;
+ double time_delta = (now - last_tick_time_).InMillisecondsF();
+ position_delta = velocity * time_delta;
+ }
+
+ last_tick_time_ = now;
+ return position_delta;
+}
+
+} // namespace content

Powered by Google App Engine
This is Rietveld 408576698