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

Unified Diff: content/shell/browser/shell_android.cc

Issue 117403003: Add support for closing Android Shell instances from Java. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased 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
« no previous file with comments | « content/shell/android/shell_manager.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/shell/browser/shell_android.cc
diff --git a/content/shell/browser/shell_android.cc b/content/shell/browser/shell_android.cc
index b11ba37abaa1d3c7eba35fbc76ddf17159853ba2..80a653e41b2b07f144703c390b787564a5cb1105 100644
--- a/content/shell/browser/shell_android.cc
+++ b/content/shell/browser/shell_android.cc
@@ -30,6 +30,10 @@ void Shell::PlatformExit() {
}
void Shell::PlatformCleanUp() {
+ JNIEnv* env = AttachCurrentThread();
+ if (java_object_.is_null())
+ return;
+ Java_Shell_onNativeDestroyed(env, java_object_.obj());
}
void Shell::PlatformEnableUIControl(UIControl control, bool is_enabled) {
@@ -83,8 +87,7 @@ bool Shell::PlatformIsFullscreenForTabOrPending(
}
void Shell::Close() {
- CloseShellView(java_object_.obj());
- java_object_.Reset();
+ RemoveShellView(java_object_.obj());
delete this;
}
@@ -93,4 +96,10 @@ bool Shell::Register(JNIEnv* env) {
return RegisterNativesImpl(env);
}
+// static
+void CloseShell(JNIEnv* env, jclass clazz, jlong shellPtr) {
+ Shell* shell = reinterpret_cast<Shell*>(shellPtr);
+ shell->Close();
+}
+
} // namespace content
« no previous file with comments | « content/shell/android/shell_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698