Chromium Code Reviews| Index: chromecast/browser/android/apk/src/org/chromium/chromecast/shell/CastWebContentsActivity.java |
| diff --git a/chromecast/browser/android/apk/src/org/chromium/chromecast/shell/CastWebContentsActivity.java b/chromecast/browser/android/apk/src/org/chromium/chromecast/shell/CastWebContentsActivity.java |
| index 49201cd15c82f6202791c27263ac25d671ed8258..b7c0d5f3355186e23fbe40bb45e924c305ad4a8c 100644 |
| --- a/chromecast/browser/android/apk/src/org/chromium/chromecast/shell/CastWebContentsActivity.java |
| +++ b/chromecast/browser/android/apk/src/org/chromium/chromecast/shell/CastWebContentsActivity.java |
| @@ -32,6 +32,7 @@ import org.chromium.content.browser.ContentViewCore; |
| import org.chromium.content.browser.ContentViewRenderView; |
| import org.chromium.content_public.browser.WebContents; |
| import org.chromium.ui.base.ViewAndroidDelegate; |
| +import org.chromium.ui.base.ViewRoot; |
| import org.chromium.ui.base.WindowAndroid; |
| /** |
| @@ -56,6 +57,7 @@ public class CastWebContentsActivity extends Activity { |
| private ContentViewClient mContentViewClient; |
| private ContentViewRenderView mContentViewRenderView; |
| private WindowAndroid mWindow; |
| + private ViewRoot mViewRoot; |
| private ContentViewCore mContentViewCore; |
| private ContentView mContentView; |
| @@ -104,13 +106,15 @@ public class CastWebContentsActivity extends Activity { |
| setContentView(R.layout.cast_web_contents_activity); |
| mWindow = new WindowAndroid(this); |
| + mViewRoot = ViewRoot.create(mWindow); |
|
boliu
2017/02/13 22:58:08
errrrr, missing destroy
Jinsuk Kim
2017/02/14 05:09:59
Done. Put it in onDestroy()
|
| + |
| mContentViewRenderView = new ContentViewRenderView(this) { |
| @Override |
| protected void onReadyToRender() { |
| setOverlayVideoMode(true); |
| } |
| }; |
| - mContentViewRenderView.onNativeLibraryLoaded(mWindow); |
| + mContentViewRenderView.onNativeLibraryLoaded(mViewRoot); |
| // Setting the background color to black avoids rendering a white splash screen |
| // before the players are loaded. See crbug/307113 for details. |
| mContentViewRenderView.setSurfaceViewBackgroundColor(Color.BLACK); |
| @@ -314,7 +318,7 @@ public class CastWebContentsActivity extends Activity { |
| mContentViewCore = new ContentViewCore(this, ""); |
| mContentView = ContentView.createContentView(this, mContentViewCore); |
| mContentViewCore.initialize(ViewAndroidDelegate.createBasicDelegate(mContentView), |
| - mContentView, webContents, mWindow); |
| + mContentView, webContents, mViewRoot); |
| mContentViewClient = new ContentViewClient(); |
| mContentViewCore.setContentViewClient(mContentViewClient); |
| // Enable display of current webContents. |