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

Unified Diff: content/public/android/java/src/org/chromium/content/browser/webcontents/WebContentsImpl.java

Issue 2502763003: Introduce ViewRoot to forward input/view events to native (Closed)
Patch Set: addressed comments Created 4 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/public/android/java/src/org/chromium/content/browser/webcontents/WebContentsImpl.java
diff --git a/content/public/android/java/src/org/chromium/content/browser/webcontents/WebContentsImpl.java b/content/public/android/java/src/org/chromium/content/browser/webcontents/WebContentsImpl.java
index 2803d37f91dad0afd556110c621b488b1f9babc3..2e733d3e32ad6f1ac83832f9bfa0b94300e60bc5 100644
--- a/content/public/android/java/src/org/chromium/content/browser/webcontents/WebContentsImpl.java
+++ b/content/public/android/java/src/org/chromium/content/browser/webcontents/WebContentsImpl.java
@@ -29,6 +29,7 @@ import org.chromium.content_public.browser.NavigationController;
import org.chromium.content_public.browser.WebContents;
import org.chromium.content_public.browser.WebContentsObserver;
import org.chromium.ui.accessibility.AXTextStyle;
+import org.chromium.ui.base.EventHandler;
import java.util.ArrayList;
import java.util.List;
@@ -98,6 +99,8 @@ import java.util.UUID;
// the same life time as native MediaSession.
private MediaSessionImpl mMediaSession;
+ private EventHandler mEventHandler;
+
private WebContentsImpl(
long nativeWebContentsAndroid, NavigationController navigationController) {
mNativeWebContentsAndroid = nativeWebContentsAndroid;
@@ -481,6 +484,14 @@ import java.util.UUID;
sizes.add(new Rect(0, 0, width, height));
}
+ @Override
+ public EventHandler getEventHandler() {
+ if (mEventHandler == null) {
+ mEventHandler = new EventHandler(nativeGetNativeView(mNativeWebContentsAndroid));
+ }
+ return mEventHandler;
+ }
+
// This is static to avoid exposing a public destroy method on the native side of this class.
private static native void nativeDestroyWebContents(long webContentsAndroidPtr);
@@ -541,4 +552,5 @@ import java.util.UUID;
String url, boolean isFavicon, int maxBitmapSize,
boolean bypassCache, ImageDownloadCallback callback);
private native void nativeDismissTextHandles(long nativeWebContentsAndroid);
+ private native long nativeGetNativeView(long nativeWebContentsAndroid);
}

Powered by Google App Engine
This is Rietveld 408576698