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

Unified Diff: chromecast/browser/android/apk/src/org/chromium/chromecast/shell/CastWindowAndroid.java

Issue 2595263002: Introduce ViewRoot forwarding input/view events to native (Closed)
Patch Set: view_root.java_obj_... 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
« no previous file with comments | « chrome/browser/android/vr_shell/vr_compositor.cc ('k') | content/browser/android/content_view_core_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromecast/browser/android/apk/src/org/chromium/chromecast/shell/CastWindowAndroid.java
diff --git a/chromecast/browser/android/apk/src/org/chromium/chromecast/shell/CastWindowAndroid.java b/chromecast/browser/android/apk/src/org/chromium/chromecast/shell/CastWindowAndroid.java
index 99b64bc5d6aa2886b4649dfbc3ccb1b1b9d581d0..9fab3b0af3c7633e20e102da4f7a6fffe9fdc93e 100644
--- a/chromecast/browser/android/apk/src/org/chromium/chromecast/shell/CastWindowAndroid.java
+++ b/chromecast/browser/android/apk/src/org/chromium/chromecast/shell/CastWindowAndroid.java
@@ -28,6 +28,7 @@ import org.chromium.content_public.browser.NavigationController;
import org.chromium.content_public.browser.WebContents;
import org.chromium.content_public.browser.WebContentsObserver;
import org.chromium.ui.base.ViewAndroidDelegate;
+import org.chromium.ui.base.ViewRoot;
import org.chromium.ui.base.WindowAndroid;
/**
@@ -48,6 +49,7 @@ public class CastWindowAndroid extends LinearLayout {
private WebContents mWebContents;
private WebContentsObserver mWebContentsObserver;
private WindowAndroid mWindow;
+ private ViewRoot mViewRoot;
/**
* Constructor for inflating via XML.
@@ -79,6 +81,10 @@ public class CastWindowAndroid extends LinearLayout {
*/
public void setWindow(WindowAndroid window) {
mWindow = window;
+ if (window == null) {
+ mContentViewCore.destroy();
+ mViewRoot.destroy();
+ }
}
/**
@@ -134,9 +140,10 @@ public class CastWindowAndroid extends LinearLayout {
String productVersion) {
Context context = getContext();
mContentViewCore = new ContentViewCore(context, productVersion);
+ mViewRoot = ViewRoot.create(mWindow);
ContentView view = ContentView.createContentView(context, mContentViewCore);
mContentViewCore.initialize(ViewAndroidDelegate.createBasicDelegate(view), view,
- webContents, mWindow);
+ webContents, mViewRoot);
mWebContents = mContentViewCore.getWebContents();
mNavigationController = mWebContents.getNavigationController();
mRenderProcessId = renderProcessId;
« no previous file with comments | « chrome/browser/android/vr_shell/vr_compositor.cc ('k') | content/browser/android/content_view_core_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698