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

Unified Diff: content/shell/android/shell_manager.cc

Issue 10035034: Implement the skeleton of an android content shell. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removed drawable png as it was checked in separately. Created 8 years, 8 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/shell_manager.cc
diff --git a/content/shell/android/shell_manager.cc b/content/shell/android/shell_manager.cc
new file mode 100644
index 0000000000000000000000000000000000000000..edfc9e2740de7d4222d3a13e96708afd77eea41a
--- /dev/null
+++ b/content/shell/android/shell_manager.cc
@@ -0,0 +1,40 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "content/shell/android/shell_manager.h"
+
+#include "base/android/jni_android.h"
+#include "base/android/scoped_java_ref.h"
+#include "base/lazy_instance.h"
+#include "content/shell/android/shell_view.h"
+#include "jni/shell_manager_jni.h"
+
+using base::android::ScopedJavaLocalRef;
+
+base::LazyInstance<base::android::ScopedJavaGlobalRef<jobject> >
+ g_content_shell_manager = LAZY_INSTANCE_INITIALIZER;
+
+namespace content {
+
+ShellView* CreateShellView() {
+ JNIEnv* env = base::android::AttachCurrentThread();
+ return reinterpret_cast<ShellView*>(Java_ShellManager_createShell(
+ env, g_content_shell_manager.Get().obj()));
+}
+
+// Register native methods
+bool RegisterShellManager(JNIEnv* env) {
+ return RegisterNativesImpl(env);
+}
+
+} // namespace content
+
+// ----------------------------------------------------------------------------
+// Native JNI methods
+// ----------------------------------------------------------------------------
+
+void Init(JNIEnv* env, jclass clazz, jobject obj) {
+ g_content_shell_manager.Get().Reset(
+ base::android::ScopedJavaLocalRef<jobject>(env, obj));
+}

Powered by Google App Engine
This is Rietveld 408576698