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

Unified Diff: ui/android/java/src/org/chromium/ui/base/ViewRoot.java

Issue 2595263002: Introduce ViewRoot forwarding input/view events to native (Closed)
Patch Set: tests Created 3 years, 12 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: ui/android/java/src/org/chromium/ui/base/ViewRoot.java
diff --git a/ui/android/java/src/org/chromium/ui/base/ViewRoot.java b/ui/android/java/src/org/chromium/ui/base/ViewRoot.java
index c224e8e3ed8c9cdfd31b3ed2e783e090ea42a4e7..e4ac856a6b74c0cc035ac6969311710fc4a84148 100644
--- a/ui/android/java/src/org/chromium/ui/base/ViewRoot.java
+++ b/ui/android/java/src/org/chromium/ui/base/ViewRoot.java
@@ -20,13 +20,12 @@ public class ViewRoot {
// the native instance is alive.
private long mNativeView;
- @CalledByNative
- private static ViewRoot create(long nativeView) {
- return new ViewRoot(nativeView);
+ public static ViewRoot create(WindowAndroid window) {
+ return new ViewRoot(window);
}
- private ViewRoot(long nativeView) {
- mNativeView = nativeView;
+ private ViewRoot(WindowAndroid window) {
+ mNativeView = nativeInit(window.getNativePointer());
}
/**
@@ -41,10 +40,16 @@ public class ViewRoot {
}
@CalledByNative
+ private long getNativePtr() {
+ return mNativeView;
+ }
+
+ @CalledByNative
private void onDestroyNativeView() {
mNativeView = 0;
}
- private static native void nativeOnPhysicalBackingSizeChanged(long viewAndroid,
+ private native long nativeInit(long windowNativePointer);
+ private native void nativeOnPhysicalBackingSizeChanged(long nativeViewRoot,
int width, int height);
}

Powered by Google App Engine
This is Rietveld 408576698