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

Unified Diff: content/public/android/java/src/org/chromium/content_public/browser/EventForwarder.java

Issue 2708613002: Add EventForwarder for routing touch events (Closed)
Patch Set: - Created 3 years, 10 months 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/public/android/java/src/org/chromium/content_public/browser/EventForwarder.java
diff --git a/content/public/android/java/src/org/chromium/content_public/browser/EventForwarder.java b/content/public/android/java/src/org/chromium/content_public/browser/EventForwarder.java
new file mode 100644
index 0000000000000000000000000000000000000000..a727bca6b680898887265a2b453a49b6d4947336
--- /dev/null
+++ b/content/public/android/java/src/org/chromium/content_public/browser/EventForwarder.java
@@ -0,0 +1,34 @@
+// Copyright 2017 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.
+
+package org.chromium.content_public.browser;
+
+import android.view.MotionEvent;
+
+/**
+ * Public interface which defines the methods used to forward input/view events
+ * to native. Call {@link WebContents#getEventForwarder()} to get the instance
+ * implemented for the associated {@link WebContents} internally.
+ */
+public interface EventForwarder {
+ /**
+ * Sets the current amount to offset incoming touch events by (including MotionEvent and
+ * DragEvent). This is used to handle content moving and not lining up properly with the
+ * android input system.
+ * @param dx The X offset in pixels to shift touch events.
+ * @param dy The Y offset in pixels to shift touch events.
+ */
+ void setCurrentTouchEventOffsets(float dx, float dy);
+
+ /**
+ * @see {@link android.view.View.onTouchEvent(MotionEvent)
+ */
+ boolean onTouchEvent(MotionEvent event);
+
+ /**
+ * Called by PopupWindow-based touch handles.
+ * @param event the MotionEvent targeting the handle.
+ */
+ boolean onTouchHandleEvent(MotionEvent event);
+}

Powered by Google App Engine
This is Rietveld 408576698