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..f4b8fb6ddad2594157d3df80d9c15772861b04b7 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,8 +309,7 @@ public class ContentViewCore implements MotionEventDelegate, NavigationClient { |
* |
* @return A ContainerViewDelegate that can be used to add and remove views. |
*/ |
- @CalledByNative |
- public ContainerViewDelegate getContainerViewDelegate() { |
+ private ContainerViewDelegate getContainerViewDelegate() { |
return new ContainerViewDelegate() { |
@Override |
public void addViewToContainerView(View view) { |
@@ -480,8 +483,11 @@ public class ContentViewCore implements MotionEventDelegate, NavigationClient { |
(Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN); |
mContainerView = containerView; |
+ mNativeView = new NativeView(nativeWindow, getContainerViewDelegate()); |
+ |
mNativeContentViewCore = nativeInit(mHardwareAccelerated, inputEventsDeliveredAtVSync, |
- nativeWebContents, nativeWindow.getNativePointer()); |
+ nativeWebContents, mNativeView.getNativePointer(), |
+ nativeWindow.getNativePointer()); |
mContentSettings = new ContentSettings( |
this, mNativeContentViewCore, isAccessFromFileURLsGrantedByDefault); |
initializeContainerView(internalDispatcher); |
@@ -2646,7 +2652,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); |