Chromium Code Reviews| Index: content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java |
| diff --git a/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java b/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java |
| index 9b8cde61ef94cdbf6f262c24e2cc6553a9fc680b..1f96bf49cb19ab15b70d37a075896716ab5b6e8b 100644 |
| --- a/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java |
| +++ b/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java |
| @@ -45,6 +45,8 @@ import org.chromium.content.browser.ContentViewGestureHandler.MotionEventDelegat |
| import org.chromium.content.browser.ImeAdapter.AdapterInputConnectionFactory; |
| import org.chromium.content.browser.accessibility.AccessibilityInjector; |
| import org.chromium.content.common.TraceEvent; |
| +import org.chromium.ui.ContainerViewDelegate; |
| +import org.chromium.ui.NativeView; |
| import org.chromium.ui.gfx.NativeWindow; |
| import java.lang.annotation.Annotation; |
| @@ -242,6 +244,8 @@ public class ContentViewCore implements MotionEventDelegate, NavigationClient { |
| // Whether we use hardware-accelerated drawing. |
| private boolean mHardwareAccelerated = false; |
| + private NativeView mNativeView; |
| + |
| /** |
| * Constructs a new ContentViewCore. Embedders must call initialize() after constructing |
| * a ContentViewCore and before using it. |
| @@ -305,7 +309,7 @@ public class ContentViewCore implements MotionEventDelegate, NavigationClient { |
| * |
| * @return A ContainerViewDelegate that can be used to add and remove views. |
| */ |
| - @CalledByNative |
| + @VisibleForTesting |
| public ContainerViewDelegate getContainerViewDelegate() { |
| return new ContainerViewDelegate() { |
| @Override |
| @@ -480,8 +484,11 @@ public class ContentViewCore implements MotionEventDelegate, NavigationClient { |
| (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN); |
| mContainerView = containerView; |
| + mNativeView = new NativeView(nativeWindow, getContainerViewDelegate()); |
|
joth
2013/04/12 19:00:48
not sure we can doing anything about it, but the w
nilesh
2013/04/12 19:07:10
+1
aurimas (slooooooooow)
2013/04/12 22:00:41
Done.
|
| + |
| mNativeContentViewCore = nativeInit(mHardwareAccelerated, inputEventsDeliveredAtVSync, |
| - nativeWebContents, nativeWindow.getNativePointer()); |
| + nativeWebContents, mNativeView.getNativePointer(), |
| + nativeWindow.getNativePointer()); |
| mContentSettings = new ContentSettings( |
| this, mNativeContentViewCore, isAccessFromFileURLsGrantedByDefault); |
| initializeContainerView(internalDispatcher); |
| @@ -633,6 +640,7 @@ public class ContentViewCore implements MotionEventDelegate, NavigationClient { |
| if (mNativeContentViewCore != 0) { |
| nativeOnJavaContentViewCoreDestroyed(mNativeContentViewCore); |
| } |
| + mNativeView.destroy(); |
| mNativeContentViewCore = 0; |
| mContentSettings = null; |
| mJavaScriptInterfaces.clear(); |
| @@ -2646,7 +2654,7 @@ public class ContentViewCore implements MotionEventDelegate, NavigationClient { |
| } |
| private native int nativeInit(boolean hardwareAccelerated, boolean inputEventsDeliveredAtVSync, |
| - int webContentsPtr, int windowAndroidPtr); |
| + int webContentsPtr, int viewAndroidPtr, int windowAndroidPtr); |
| private native void nativeOnJavaContentViewCoreDestroyed(int nativeContentViewCoreImpl); |