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

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

Issue 1284343005: NOT FOR REVIEW: Aura on Android - content shell compiles Base URL: https://chromium.googlesource.com/chromium/src.git@build_ALL_patch
Patch Set: Created 5 years, 4 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/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) {

Powered by Google App Engine
This is Rietveld 408576698