Index: content/shell/browser/shell_views.cc |
diff --git a/content/shell/browser/shell_views.cc b/content/shell/browser/shell_views.cc |
index 4ce0fa6806ffb5a87c9390f0a4659a804a9e6db1..a9b5831f28ead8c5d9f3941076ee7d4183e7ae18 100644 |
--- a/content/shell/browser/shell_views.cc |
+++ b/content/shell/browser/shell_views.cc |
@@ -49,6 +49,14 @@ |
#include <io.h> |
#endif |
+#if defined(OS_ANDROID) |
+#include "jni/Shell_jni.h" |
+#endif |
+ |
+#if defined(OS_ANDROID) |
+using base::android::AttachCurrentThread; |
+#endif |
+ |
namespace content { |
namespace { |
@@ -405,6 +413,17 @@ gfx::Screen* Shell::test_screen_ = NULL; |
views::ViewsDelegate* Shell::views_delegate_ = NULL; |
// static |
+#if defined(OS_ANDROID) |
+bool Shell::Register(JNIEnv* env) { |
+ return RegisterNativesImpl(env); |
+} |
+ |
+void CloseShell(JNIEnv* env, jclass clazz, jlong shellPtr) { |
+ Shell* shell = reinterpret_cast<Shell*>(shellPtr); |
+ shell->Close(); |
+} |
+#endif |
+ |
void Shell::PlatformInitialize(const gfx::Size& default_window_size) { |
#if defined(OS_WIN) |
_setmode(_fileno(stdout), _O_BINARY); |
@@ -443,6 +462,12 @@ void Shell::PlatformExit() { |
} |
void Shell::PlatformCleanUp() { |
+#if defined(OS_ANDROID) |
+ JNIEnv* env = AttachCurrentThread(); |
+ if (java_object_.is_null()) |
+ return; |
+ Java_Shell_onNativeDestroyed(env, java_object_.obj()); |
+#endif |
} |
void Shell::PlatformEnableUIControl(UIControl control, bool is_enabled) { |