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

Unified Diff: android_webview/java/src/org/chromium/android_webview/AwContents.java

Issue 2595263002: Introduce ViewRoot forwarding input/view events to native (Closed)
Patch Set: updateViewRoot, ... Created 3 years, 11 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: 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 f868572acdf78ff9beea53b8581a82c4d16136e4..ac2e65cad39836f51c175f8f5a18c92f9c1ac0e9 100644
--- a/android_webview/java/src/org/chromium/android_webview/AwContents.java
+++ b/android_webview/java/src/org/chromium/android_webview/AwContents.java
@@ -812,8 +812,8 @@ public class AwContents implements SmartClipProvider, PostMessageSender.PostMess
Context context, ViewAndroidDelegate viewDelegate,
InternalAccessDelegate internalDispatcher, WebContents webContents,
GestureStateListener gestureStateListener, ContentViewClient contentViewClient,
- WindowAndroid windowAndroid) {
- contentViewCore.initialize(viewDelegate, internalDispatcher, webContents, windowAndroid);
+ WindowAndroid windowAndroid, ViewRoot viewRoot) {
+ contentViewCore.initialize(viewDelegate, internalDispatcher, webContents, viewRoot);
contentViewCore.setActionModeCallback(
new AwActionModeCallback(mContext, this,
contentViewCore.getActionModeCallbackHelper()));
@@ -1056,9 +1056,10 @@ public class AwContents implements SmartClipProvider, PostMessageSender.PostMess
mContentViewCore = new ContentViewCore(mContext, PRODUCT_VERSION);
mViewAndroidDelegate = new AwViewAndroidDelegate(mContainerView,
mContentViewCore.getRenderCoordinates());
+ mViewRoot = ViewRoot.create(mWindowAndroid.getWindowAndroid());
initializeContentViewCore(mContentViewCore, mContext, mViewAndroidDelegate,
mInternalAccessAdapter, webContents, new AwGestureStateListener(),
- mContentViewClient, mWindowAndroid.getWindowAndroid());
+ mContentViewClient, mWindowAndroid.getWindowAndroid(), mViewRoot);
nativeSetJavaPeers(mNativeAwContents, this, mWebContentsDelegate, mContentsClientBridge,
mIoThreadClient, mInterceptNavigationDelegate);
mWebContents = mContentViewCore.getWebContents();
@@ -1202,6 +1203,8 @@ public class AwContents implements SmartClipProvider, PostMessageSender.PostMess
mWebContentsObserver = null;
mContentViewCore.destroy();
mContentViewCore = null;
+ mViewRoot.destroy();
boliu 2017/01/05 19:09:28 Finding the right place to call destroy is tricky
Jinsuk Kim 2017/01/05 22:30:15 Done. I'm still keeping the code nulling out mView
+ mViewRoot = null;
mNativeAwContents = 0;
mWebContents = null;
mNavigationController = null;
@@ -3209,7 +3212,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);
- getViewRoot().onPhysicalBackingSizeChanged(w, h);
+ mViewRoot.onPhysicalBackingSizeChanged(w, h);
mContentViewCore.onSizeChanged(w, h, ow, oh);
nativeOnSizeChanged(mNativeAwContents, w, h, ow, oh);
}
@@ -3285,13 +3288,6 @@ 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() {
@@ -3395,5 +3391,4 @@ 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.cc » ('j') | content/browser/android/content_view_core_impl.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698