summaryrefslogtreecommitdiffstats
path: root/content/port/browser
diff options
context:
space:
mode:
authornduca@chromium.org <nduca@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-07-13 21:30:58 +0000
committernduca@chromium.org <nduca@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-07-13 21:30:58 +0000
commita39ca1650e8ee83553a2c91c6712a71647fa2ff1 (patch)
tree4fd2a047913ddcefaf9f94e5f0e63f3719df0399 /content/port/browser
parent69557d3f564076a7708674d4b5d0d98b3978a6d9 (diff)
downloadchromium_src-a39ca1650e8ee83553a2c91c6712a71647fa2ff1.zip
chromium_src-a39ca1650e8ee83553a2c91c6712a71647fa2ff1.tar.gz
chromium_src-a39ca1650e8ee83553a2c91c6712a71647fa2ff1.tar.bz2
Expose a benchmark-only beginSmoothScroll API to JS.
Credit for this goes to Cem Kocagil, who did key prototyping in http://codereview.chromium.org/10164021/ BUG=120829 Review URL: https://chromiumcodereview.appspot.com/10443050 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@146657 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/port/browser')
-rw-r--r--content/port/browser/render_widget_host_view_port.h7
-rw-r--r--content/port/browser/smooth_scroll_gesture.h33
2 files changed, 40 insertions, 0 deletions
diff --git a/content/port/browser/render_widget_host_view_port.h b/content/port/browser/render_widget_host_view_port.h
index adc2f35..2c31ac0 100644
--- a/content/port/browser/render_widget_host_view_port.h
+++ b/content/port/browser/render_widget_host_view_port.h
@@ -40,6 +40,8 @@ struct WebScreenInfo;
namespace content {
+class SmoothScrollGesture;
+
// This is the larger RenderWidgetHostView interface exposed only
// within content/ and to embedders looking to port to new platforms.
// RenderWidgetHostView class hierarchy described in render_widget_host_view.h.
@@ -248,6 +250,11 @@ class CONTENT_EXPORT RenderWidgetHostViewPort : public RenderWidgetHostView {
virtual void ProcessTouchAck(WebKit::WebInputEvent::Type type,
bool processed) = 0;
+ // Asks the view to create a smooth scroll gesture that will be used to
+ // simulate a user-initiated scroll.
+ virtual SmoothScrollGesture* CreateSmoothScrollGesture(
+ bool scroll_down, bool scroll_far) = 0;
+
virtual void SetHasHorizontalScrollbar(bool has_horizontal_scrollbar) = 0;
virtual void SetScrollOffsetPinning(
bool is_pinned_to_left, bool is_pinned_to_right) = 0;
diff --git a/content/port/browser/smooth_scroll_gesture.h b/content/port/browser/smooth_scroll_gesture.h
new file mode 100644
index 0000000..6d6672c
--- /dev/null
+++ b/content/port/browser/smooth_scroll_gesture.h
@@ -0,0 +1,33 @@
+// 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.
+
+#ifndef CONTENT_PORT_BROWSER_SMOOTH_SCROLL_GESTURE_H_
+#define CONTENT_PORT_BROWSER_SMOOTH_SCROLL_GESTURE_H_
+
+#include "base/time.h"
+
+namespace content {
+
+class RenderWidgetHost;
+
+// This is a base class representing a single scroll gesture. These gestures are
+// paired with the rendering benchmarking system to (automatically) measure how
+// smoothnly chrome is responding to user input.
+class SmoothScrollGesture {
+ public:
+ virtual ~SmoothScrollGesture() {}
+
+ // When called, the gesture should compute its state at the provided timestamp
+ // and send the right input events to the provided RenderWidgetHost to
+ // simulate the gesture having run up to that point in time.
+ //
+ // This function should return true until the gesture is over. A false return
+ // value will stop ticking the gesture and clean it up.
+ virtual bool ForwardInputEvents(base::TimeTicks now,
+ RenderWidgetHost* host) = 0;
+};
+
+} // namespace content
+
+#endif // CONTENT_PORT_BROWSER_SMOOTH_SCROLL_GESTURE_H_