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

Unified Diff: content/public/android/java/src/org/chromium/content/browser/ContentViewRenderView.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: content/public/android/java/src/org/chromium/content/browser/ContentViewRenderView.java
diff --git a/content/public/android/java/src/org/chromium/content/browser/ContentViewRenderView.java b/content/public/android/java/src/org/chromium/content/browser/ContentViewRenderView.java
index 80b3593f3b1d798dce4770b6e686a07776b7ebf5..afeca29ca990e8c48d71f2433f29d9af2e8cf02e 100644
--- a/content/public/android/java/src/org/chromium/content/browser/ContentViewRenderView.java
+++ b/content/public/android/java/src/org/chromium/content/browser/ContentViewRenderView.java
@@ -31,7 +31,7 @@ public class ContentViewRenderView extends FrameLayout {
private SurfaceHolder.Callback mSurfaceCallback;
private final SurfaceView mSurfaceView;
- protected ContentViewCore mContentViewCore;
+ private ViewRoot mViewRoot;
/**
* Constructs a new ContentViewRenderView.
@@ -71,8 +71,8 @@ public class ContentViewRenderView extends FrameLayout {
assert mNativeContentViewRenderView != 0;
nativeSurfaceChanged(mNativeContentViewRenderView,
format, width, height, holder.getSurface());
- if (mContentViewCore != null) {
- getViewRoot().onPhysicalBackingSizeChanged(width, height);
+ if (mViewRoot != null) {
+ mViewRoot.onPhysicalBackingSizeChanged(width, height);
}
}
@@ -94,10 +94,6 @@ public class ContentViewRenderView extends FrameLayout {
mSurfaceView.setVisibility(VISIBLE);
}
- private ViewRoot getViewRoot() {
- return mContentViewCore.getWindowAndroid().getViewRoot();
- }
-
/**
* Sets the background color of the surface view. This method is necessary because the
* background color of ContentViewRenderView itself is covered by the background of
@@ -129,12 +125,11 @@ public class ContentViewRenderView extends FrameLayout {
public void setCurrentContentViewCore(ContentViewCore contentViewCore) {
assert mNativeContentViewRenderView != 0;
- mContentViewCore = contentViewCore;
-
- if (mContentViewCore != null) {
- getViewRoot().onPhysicalBackingSizeChanged(getWidth(), getHeight());
+ if (contentViewCore != null) {
+ mViewRoot = contentViewCore.getViewRoot();
+ mViewRoot.onPhysicalBackingSizeChanged(getWidth(), getHeight());
nativeSetCurrentWebContents(
- mNativeContentViewRenderView, mContentViewCore.getWebContents());
+ mNativeContentViewRenderView, contentViewCore.getWebContents());
} else {
nativeSetCurrentWebContents(mNativeContentViewRenderView, null);
}

Powered by Google App Engine
This is Rietveld 408576698