summaryrefslogtreecommitdiffstats
path: root/content/port
diff options
context:
space:
mode:
authorrch@chromium.org <rch@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-20 19:02:46 +0000
committerrch@chromium.org <rch@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-20 19:02:46 +0000
commit3471ef4ece47d01bdac4067d192cfab923fee02b (patch)
treec921a090cc1ae10c205b66e8680bbacfc229f62f /content/port
parente60f5cd98155cec220e3dc3142c99fdd7bfbe7f5 (diff)
downloadchromium_src-3471ef4ece47d01bdac4067d192cfab923fee02b.zip
chromium_src-3471ef4ece47d01bdac4067d192cfab923fee02b.tar.gz
chromium_src-3471ef4ece47d01bdac4067d192cfab923fee02b.tar.bz2
Revert 236254 "Replace old with new synthetic gesture framework."
> Replace old with new synthetic gesture framework. > > - Remove current implementation of synthetic gestures. > - Rename temporarily named classes and files of new synthetic gesture framework > (e.g. SyntheticGestureNew -> SyntheticGesture). > - Link up new implementation in browser and renderer. > - Hook up synthetic gesture controller to input flushing in RWHI. > - Update JavaScript front-end and Telemetry. > > BUG=297980 > > Review URL: https://codereview.chromium.org/62443007 TBR=dominikg@chromium.org Review URL: https://codereview.chromium.org/79143002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@236264 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/port')
-rw-r--r--content/port/browser/render_widget_host_view_port.h11
-rw-r--r--content/port/browser/synthetic_gesture.h36
2 files changed, 47 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 fd8954f..bd13f73 100644
--- a/content/port/browser/render_widget_host_view_port.h
+++ b/content/port/browser/render_widget_host_view_port.h
@@ -270,6 +270,17 @@ class CONTENT_EXPORT RenderWidgetHostViewPort : public RenderWidgetHostView,
virtual void ProcessAckedTouchEvent(const TouchEventWithLatencyInfo& touch,
InputEventAckState ack_result) = 0;
+ // Asks the view to create a synthetic gesture that will be used to
+ // simulate a user-initiated scroll.
+ virtual SyntheticGesture* CreateSmoothScrollGesture(
+ bool scroll_down, int pixels_to_scroll, int mouse_event_x,
+ int mouse_event_y) = 0;
+
+ // Asks the view to create a synthetic gesture that will be used to
+ // simulate a user-initiated pinch-to-zoom.
+ virtual SyntheticGesture* CreatePinchGesture(
+ bool zoom_in, int pixels_to_move, int anchor_x, int anchor_y) = 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/synthetic_gesture.h b/content/port/browser/synthetic_gesture.h
new file mode 100644
index 0000000..4330d76
--- /dev/null
+++ b/content/port/browser/synthetic_gesture.h
@@ -0,0 +1,36 @@
+// Copyright 2013 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_SYNTHETIC_GESTURE_H_
+#define CONTENT_PORT_BROWSER_SYNTHETIC_GESTURE_H_
+
+#include "base/memory/ref_counted.h"
+#include "base/time/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 SyntheticGesture : public base::RefCounted<SyntheticGesture> {
+ public:
+
+ // 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;
+ protected:
+ friend class base::RefCounted<SyntheticGesture>;
+ virtual ~SyntheticGesture() {}
+};
+
+} // namespace content
+
+#endif // CONTENT_PORT_BROWSER_SYNTHETIC_GESTURE_H_