Index: content/shell/android/java/src/org/chromium/content_shell/ShellManager.java |
diff --git a/content/shell/android/java/src/org/chromium/content_shell/ShellManager.java b/content/shell/android/java/src/org/chromium/content_shell/ShellManager.java |
index aad119716bb037582d6d59c34c68cba40865a031..a491294d19f5e1b33db98d556ded948eaf53140e 100644 |
--- a/content/shell/android/java/src/org/chromium/content_shell/ShellManager.java |
+++ b/content/shell/android/java/src/org/chromium/content_shell/ShellManager.java |
@@ -11,6 +11,7 @@ import android.widget.FrameLayout; |
import org.chromium.base.CalledByNative; |
import org.chromium.base.JNINamespace; |
+import org.chromium.base.ThreadUtils; |
import org.chromium.content.browser.ContentView; |
import org.chromium.content.browser.ContentViewRenderView; |
import org.chromium.ui.base.WindowAndroid; |
@@ -82,19 +83,20 @@ public class ShellManager extends FrameLayout { |
* @param url The URL the shell should load upon creation. |
*/ |
public void launchShell(String url) { |
+ ThreadUtils.assertOnUiThread(); |
nativeLaunchShell(url); |
} |
@SuppressWarnings("unused") |
@CalledByNative |
- private Object createShell() { |
+ private Object createShell(long nativeShellPtr) { |
assert mContentViewRenderView != null; |
LayoutInflater inflater = |
(LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE); |
Shell shellView = (Shell) inflater.inflate(R.layout.shell_view, null); |
- shellView.setWindow(mWindow); |
+ shellView.initialize(nativeShellPtr, mWindow); |
- if (mActiveShell != null) closeShell(mActiveShell); |
+ if (mActiveShell != null) mActiveShell.close(); |
shellView.setContentViewRenderView(mContentViewRenderView); |
addView(shellView, new FrameLayout.LayoutParams( |
@@ -111,12 +113,11 @@ public class ShellManager extends FrameLayout { |
@SuppressWarnings("unused") |
@CalledByNative |
- private void closeShell(Shell shellView) { |
+ private void removeShell(Shell shellView) { |
if (shellView == mActiveShell) mActiveShell = null; |
ContentView contentView = shellView.getContentView(); |
if (contentView != null) contentView.onHide(); |
shellView.setContentViewRenderView(null); |
- shellView.setWindow(null); |
removeView(shellView); |
} |