summaryrefslogtreecommitdiffstats
path: root/content/port
diff options
context:
space:
mode:
authordominikg@chromium.org <dominikg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-08-23 15:18:12 +0000
committerdominikg@chromium.org <dominikg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-08-23 15:18:12 +0000
commit79fa22e217ec8793c486944b69568629adb20d95 (patch)
tree1c6e4d4549ae2379f4d631fe71e7d600aec57a1e /content/port
parent296a9999fb46f314cfcc5492265273d99e6ced5c (diff)
downloadchromium_src-79fa22e217ec8793c486944b69568629adb20d95.zip
chromium_src-79fa22e217ec8793c486944b69568629adb20d95.tar.gz
chromium_src-79fa22e217ec8793c486944b69568629adb20d95.tar.bz2
Refactor synthetic gesture handling to prepare for more gestures.
Currently there's only one gesture, smooth scroll. This patch provides changes that will make it easier to add new gestures. Functionality that's independent of scrolling has been renamed to SyntheticGesture*. Since many touch gestures are variations of touch-drag (with one or more pointers) this patch introduces a new GenericTouchGesture Java class to simulate all of these gestures. Currently, it only supports a single pointer, but it can be easily extented to support more. The smooth scroll gesture uses this class for the Android implementation. BUG=264810 Review URL: https://chromiumcodereview.appspot.com/22883004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@219280 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/port')
-rw-r--r--content/port/browser/render_widget_host_view_port.h6
-rw-r--r--content/port/browser/synthetic_gesture.h (renamed from content/port/browser/smooth_scroll_gesture.h)14
2 files changed, 10 insertions, 10 deletions
diff --git a/content/port/browser/render_widget_host_view_port.h b/content/port/browser/render_widget_host_view_port.h
index 59d4653..162a7fb 100644
--- a/content/port/browser/render_widget_host_view_port.h
+++ b/content/port/browser/render_widget_host_view_port.h
@@ -41,7 +41,7 @@ struct WebScreenInfo;
namespace content {
class BackingStore;
class RenderWidgetHostViewFrameSubscriber;
-class SmoothScrollGesture;
+class SyntheticGesture;
struct WebPluginGeometry;
struct NativeWebKeyboardEvent;
@@ -263,9 +263,9 @@ class CONTENT_EXPORT RenderWidgetHostViewPort : public RenderWidgetHostView,
virtual void ProcessAckedTouchEvent(const TouchEventWithLatencyInfo& touch,
InputEventAckState ack_result) = 0;
- // Asks the view to create a smooth scroll gesture that will be used to
+ // Asks the view to create a synthetic gesture that will be used to
// simulate a user-initiated scroll.
- virtual SmoothScrollGesture* CreateSmoothScrollGesture(
+ virtual SyntheticGesture* CreateSmoothScrollGesture(
bool scroll_down, int pixels_to_scroll, int mouse_event_x,
int mouse_event_y) = 0;
diff --git a/content/port/browser/smooth_scroll_gesture.h b/content/port/browser/synthetic_gesture.h
index d4682cc..4330d76 100644
--- a/content/port/browser/smooth_scroll_gesture.h
+++ b/content/port/browser/synthetic_gesture.h
@@ -1,9 +1,9 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// 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_SMOOTH_SCROLL_GESTURE_H_
-#define CONTENT_PORT_BROWSER_SMOOTH_SCROLL_GESTURE_H_
+#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"
@@ -15,7 +15,7 @@ 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 base::RefCounted<SmoothScrollGesture> {
+class SyntheticGesture : public base::RefCounted<SyntheticGesture> {
public:
// When called, the gesture should compute its state at the provided timestamp
@@ -27,10 +27,10 @@ class SmoothScrollGesture : public base::RefCounted<SmoothScrollGesture> {
virtual bool ForwardInputEvents(base::TimeTicks now,
RenderWidgetHost* host) = 0;
protected:
- friend class base::RefCounted<SmoothScrollGesture>;
- virtual ~SmoothScrollGesture() {}
+ friend class base::RefCounted<SyntheticGesture>;
+ virtual ~SyntheticGesture() {}
};
} // namespace content
-#endif // CONTENT_PORT_BROWSER_SMOOTH_SCROLL_GESTURE_H_
+#endif // CONTENT_PORT_BROWSER_SYNTHETIC_GESTURE_H_