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

Unified Diff: content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java

Issue 14018004: [Android] Refactor NativeView to be able to use it for AutofillDialog. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 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: 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);

Powered by Google App Engine
This is Rietveld 408576698