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

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: Remove unnecessary bits. 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..b89c5986a9075ab2678f3ef76a8754988e92afbe
--- /dev/null
+++ b/content/shell/android/shell_manager.cc
@@ -0,0 +1,33 @@
+// 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;
+using content::ShellView;
+
+base::LazyInstance<base::android::ScopedJavaGlobalRef<jobject> >
+ g_content_shell_manager = LAZY_INSTANCE_INITIALIZER;
+
+void Init(JNIEnv* env, jclass clazz, jobject obj) {
+ g_content_shell_manager.Get().Reset(
+ base::android::ScopedJavaLocalRef<jobject>(env, obj));
+}
+
+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);
+}

Powered by Google App Engine
This is Rietveld 408576698