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

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: rebased/fixed tests 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
« no previous file with comments | « no previous file | android_webview/native/aw_contents.h » ('j') | ui/android/view_android.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 2d15b2cb5c048e347d8184ba9915e87d335c8e26..f868572acdf78ff9beea53b8581a82c4d16136e4 100644
--- a/android_webview/java/src/org/chromium/android_webview/AwContents.java
+++ b/android_webview/java/src/org/chromium/android_webview/AwContents.java
@@ -77,6 +77,7 @@ import org.chromium.net.NetworkChangeNotifier;
import org.chromium.ui.base.ActivityWindowAndroid;
import org.chromium.ui.base.PageTransition;
import org.chromium.ui.base.ViewAndroidDelegate;
+import org.chromium.ui.base.ViewRoot;
import org.chromium.ui.base.WindowAndroid;
import org.chromium.ui.display.DisplayAndroid.DisplayAndroidObserver;
@@ -361,6 +362,8 @@ public class AwContents implements SmartClipProvider, PostMessageSender.PostMess
private static String sCurrentLocales = "";
+ private ViewRoot mViewRoot;
+
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
@@ -1202,6 +1205,7 @@ public class AwContents implements SmartClipProvider, PostMessageSender.PostMess
mNativeAwContents = 0;
mWebContents = null;
mNavigationController = null;
+ mViewRoot = null;
Jinsuk Kim 2016/12/19 04:40:58 Added this line to fix a bug not cleaning up ViewR
boliu 2016/12/19 17:33:08 yep that's fine
mCleanupReference.cleanupNow();
mCleanupReference = null;
@@ -3205,7 +3209,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);
+ getViewRoot().onPhysicalBackingSizeChanged(w, h);
mContentViewCore.onSizeChanged(w, h, ow, oh);
nativeOnSizeChanged(mNativeAwContents, w, h, ow, oh);
}
@@ -3281,6 +3285,13 @@ public class AwContents implements SmartClipProvider, PostMessageSender.PostMess
}
}
+ private ViewRoot getViewRoot() {
+ if (mViewRoot == null) {
+ mViewRoot = nativeGetViewRoot(mNativeAwContents);
+ }
+ return mViewRoot;
+ }
+
// Return true if the GeolocationPermissionAPI should be used.
@CalledByNative
private boolean useLegacyGeolocationPermissionAPI() {
@@ -3384,4 +3395,5 @@ public class AwContents implements SmartClipProvider, PostMessageSender.PostMess
private native void nativeGrantFileSchemeAccesstoChildProcess(long nativeAwContents);
private native void nativeResumeLoadingCreatedPopupWebContents(long nativeAwContents);
+ private native ViewRoot nativeGetViewRoot(long nativeAwContents);
}
« no previous file with comments | « no previous file | android_webview/native/aw_contents.h » ('j') | ui/android/view_android.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698