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

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

Issue 14977010: Android: implement content::Shell::Close() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 7 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 | « no previous file | content/shell/android/shell_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 b3fd95030188bc880b61776468b1f0add0407cbf..2791442689fa4a7157eaeea0ad0779f4ef45fe19 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
@@ -92,12 +92,7 @@ public class ShellManager extends FrameLayout {
Shell shellView = (Shell) inflater.inflate(R.layout.shell_view, null);
shellView.setWindow(mWindow);
- removeAllViews();
- if (mActiveShell != null) {
- ContentView contentView = mActiveShell.getContentView();
- if (contentView != null) contentView.onHide();
- mActiveShell.setContentViewRenderView(null);
- }
+ if (mActiveShell != null) closeShell(mActiveShell);
shellView.setContentViewRenderView(mContentViewRenderView);
addView(shellView, new FrameLayout.LayoutParams(
@@ -112,6 +107,17 @@ public class ShellManager extends FrameLayout {
return shellView;
}
+ @SuppressWarnings("unused")
+ @CalledByNative
+ 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);
+ }
+
private static native void nativeInit(Object shellManagerInstance);
private static native void nativeLaunchShell(String url);
}
« no previous file with comments | « no previous file | content/shell/android/shell_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698