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

Unified Diff: content/shell/android/shell_view.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_view.cc
diff --git a/content/shell/android/shell_view.cc b/content/shell/android/shell_view.cc
new file mode 100644
index 0000000000000000000000000000000000000000..5b659cc8bbaf4c0eec374076d183c5b76c0b02df
--- /dev/null
+++ b/content/shell/android/shell_view.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_view.h"
+
+#include "base/android/jni_android.h"
+#include "jni/shell_view_jni.h"
+
+namespace content {
+
+ShellView::ShellView(JNIEnv* env, jobject obj)
+ : weak_java_shell_view_(env, obj) {
+}
+
+ShellView::~ShellView() {
+}
+
+void ShellView::InitFromTabContents(WebContents* tab_contents) {
+ JNIEnv* env = base::android::AttachCurrentThread();
+ Java_ShellView_initFromNativeTabContents(
+ env, weak_java_shell_view_.get(env).obj(),
+ reinterpret_cast<jint>(tab_contents));
+}
+
+// static
+bool ShellView::Register(JNIEnv* env) {
+ return RegisterNativesImpl(env);
+}
+
+} // namespace content
+
+// ----------------------------------------------------------------------------
+// Native JNI methods
+// ----------------------------------------------------------------------------
+
+static jint Init(JNIEnv* env, jobject obj) {
+ content::ShellView* shell_view = new content::ShellView(env, obj);
+ return reinterpret_cast<jint>(shell_view);
+}

Powered by Google App Engine
This is Rietveld 408576698