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

Unified Diff: content/shell/android/shell_apk/src/org/chromium/content_shell_apk/ContentShellActivity.java

Issue 2688113002: Make ViewRoot the top of the ViewAndroid tree (Closed)
Patch Set: - Created 3 years, 10 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/shell/android/shell_apk/src/org/chromium/content_shell_apk/ContentShellActivity.java
diff --git a/content/shell/android/shell_apk/src/org/chromium/content_shell_apk/ContentShellActivity.java b/content/shell/android/shell_apk/src/org/chromium/content_shell_apk/ContentShellActivity.java
index d7a2eb57c189d9d68e615a0c003a519ed22c02ec..5c40213e083cc6e1c97c51fc1552af465a412a32 100644
--- a/content/shell/android/shell_apk/src/org/chromium/content_shell_apk/ContentShellActivity.java
+++ b/content/shell/android/shell_apk/src/org/chromium/content_shell_apk/ContentShellActivity.java
@@ -28,6 +28,7 @@ import org.chromium.content_public.browser.WebContents;
import org.chromium.content_shell.Shell;
import org.chromium.content_shell.ShellManager;
import org.chromium.ui.base.ActivityWindowAndroid;
+import org.chromium.ui.base.ViewRoot;
/**
* Activity for managing the Content Shell.
@@ -41,6 +42,7 @@ public class ContentShellActivity extends Activity {
private ShellManager mShellManager;
private ActivityWindowAndroid mWindowAndroid;
+ private ViewRoot mViewRoot;
private Intent mLastSentIntent;
private String mStartupUrl;
@@ -76,7 +78,8 @@ public class ContentShellActivity extends Activity {
final boolean listenToActivityState = true;
mWindowAndroid = new ActivityWindowAndroid(this, listenToActivityState);
mWindowAndroid.restoreInstanceState(savedInstanceState);
- mShellManager.setWindow(mWindowAndroid);
+ mViewRoot = ViewRoot.create(mWindowAndroid);
+ mShellManager.setViewRoot(mViewRoot);
// Set up the animation placeholder to be the SurfaceView. This disables the
// SurfaceView's 'hole' clipping during animations that are notified to the window.
mWindowAndroid.setAnimationPlaceholderView(
@@ -214,6 +217,8 @@ public class ContentShellActivity extends Activity {
@Override
protected void onDestroy() {
if (mShellManager != null) mShellManager.destroy();
+ mViewRoot.destroy();
+ mWindowAndroid.destroy();
super.onDestroy();
}

Powered by Google App Engine
This is Rietveld 408576698