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

Unified Diff: content/shell/android/java/src/org/chromium/content_shell/ShellManager.java

Issue 130503003: Revert "Add support for closing Android Shell instances from Java." (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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/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 6663f31ea9c7e85da9051ff57945668527bb0b56..c1f1e3d685d9db57a9cb9b4989f053653a420c17 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,7 +11,6 @@ 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;
@@ -83,7 +82,6 @@ public class ShellManager extends FrameLayout {
* @param url The URL the shell should load upon creation.
*/
public void launchShell(String url) {
- ThreadUtils.assertOnUiThread();
nativeLaunchShell(url);
}
@@ -98,14 +96,14 @@ public class ShellManager extends FrameLayout {
@SuppressWarnings("unused")
@CalledByNative
- private Object createShell(long nativeShellPtr) {
+ private Object createShell() {
assert mContentViewRenderView != null;
LayoutInflater inflater =
(LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
Shell shellView = (Shell) inflater.inflate(R.layout.shell_view, null);
- shellView.initialize(nativeShellPtr, mWindow);
+ shellView.setWindow(mWindow);
- if (mActiveShell != null) mActiveShell.close();
+ if (mActiveShell != null) closeShell(mActiveShell);
shellView.setContentViewRenderView(mContentViewRenderView);
addView(shellView, new FrameLayout.LayoutParams(
@@ -122,11 +120,12 @@ public class ShellManager extends FrameLayout {
@SuppressWarnings("unused")
@CalledByNative
- private void removeShell(Shell shellView) {
+ private void closeShell(Shell shellView) {
if (shellView == mActiveShell) mActiveShell = null;
ContentView contentView = shellView.getContentView();
if (contentView != null) contentView.onHide();
shellView.setContentViewRenderView(null);
+ shellView.setWindow(null);
removeView(shellView);
}

Powered by Google App Engine
This is Rietveld 408576698