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

Unified Diff: android_webview/java/src/org/chromium/android_webview/AwContents.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: android_webview/java/src/org/chromium/android_webview/AwContents.java
diff --git a/android_webview/java/src/org/chromium/android_webview/AwContents.java b/android_webview/java/src/org/chromium/android_webview/AwContents.java
index 27eb4f4671caab62bf63eaf8954ffd387a94503e..5e452b9d7c86baf21ed3c24e818f9225f59bded0 100644
--- a/android_webview/java/src/org/chromium/android_webview/AwContents.java
+++ b/android_webview/java/src/org/chromium/android_webview/AwContents.java
@@ -76,6 +76,7 @@ import org.chromium.content_public.common.Referrer;
import org.chromium.net.NetError;
import org.chromium.net.NetworkChangeNotifier;
import org.chromium.ui.base.ActivityWindowAndroid;
+import org.chromium.ui.base.EventHandler;
import org.chromium.ui.base.PageTransition;
import org.chromium.ui.base.ViewAndroidDelegate;
import org.chromium.ui.base.WindowAndroid;
@@ -362,6 +363,8 @@ public class AwContents implements SmartClipProvider, PostMessageSender.PostMess
private static String sCurrentLocales = "";
+ private EventHandler mEventHandler;
+
private static final class AwContentsDestroyRunnable implements Runnable {
private final long mNativeAwContents;
// Hold onto a reference to the window (via its wrapper), so that it is not destroyed
@@ -3219,7 +3222,7 @@ public class AwContents implements SmartClipProvider, PostMessageSender.PostMess
// to enter fixedLayoutSize mode is sent before the first resize
// update.
mLayoutSizer.onSizeChanged(w, h, ow, oh);
- mContentViewCore.onPhysicalBackingSizeChanged(w, h);
+ getEventHandler().onPhysicalBackingSizeChanged(w, h);
mContentViewCore.onSizeChanged(w, h, ow, oh);
nativeOnSizeChanged(mNativeAwContents, w, h, ow, oh);
}
@@ -3295,6 +3298,13 @@ public class AwContents implements SmartClipProvider, PostMessageSender.PostMess
}
}
+ private EventHandler getEventHandler() {
+ if (mEventHandler == null) {
+ mEventHandler = nativeGetEventHandler(mNativeAwContents);
+ }
+ return mEventHandler;
+ }
+
// Return true if the GeolocationPermissionAPI should be used.
@CalledByNative
private boolean useLegacyGeolocationPermissionAPI() {
@@ -3398,4 +3408,5 @@ public class AwContents implements SmartClipProvider, PostMessageSender.PostMess
private native void nativeGrantFileSchemeAccesstoChildProcess(long nativeAwContents);
private native void nativeResumeLoadingCreatedPopupWebContents(long nativeAwContents);
+ private native EventHandler nativeGetEventHandler(long nativeAwContents);
}
« no previous file with comments | « no previous file | android_webview/native/aw_contents.h » ('j') | content/browser/android/content_view_core_impl.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698