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

Unified Diff: blimp/client/core/contents/android/blimp_view.cc

Issue 2270323004: Add BlimpView to a Chrome tab when Blimp is enabled. (Closed)
Patch Set: Magic now happens Created 4 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: blimp/client/core/contents/android/blimp_view.cc
diff --git a/blimp/client/core/contents/android/blimp_view.cc b/blimp/client/core/contents/android/blimp_view.cc
new file mode 100644
index 0000000000000000000000000000000000000000..9093a5f38156a3c2813799a68c83581b6ebe98ca
--- /dev/null
+++ b/blimp/client/core/contents/android/blimp_view.cc
@@ -0,0 +1,32 @@
+// Copyright 2016 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 "blimp/client/core/contents/android/blimp_view.h"
+
+#include "jni/BlimpView_jni.h"
+#include "ui/android/window_android.h"
+
+namespace blimp {
+namespace client {
+
+BlimpView::BlimpView(JNIEnv* env,
+ ui::WindowAndroid* window,
+ jobject jblimp_contents_impl) {
+ java_obj_.Reset(
+ env, Java_BlimpView_create(env, reinterpret_cast<intptr_t>(this),
+ window->GetJavaObject(), jblimp_contents_impl)
+ .obj());
+}
+
+BlimpView::~BlimpView() {
+ Java_BlimpView_clearNativePtr(base::android::AttachCurrentThread(),
+ java_obj_);
+}
+
+base::android::ScopedJavaLocalRef<jobject> BlimpView::GetJavaObject() {
+ return base::android::ScopedJavaLocalRef<jobject>(java_obj_);
+}
+
+} // namespace client
+} // namespace blimp

Powered by Google App Engine
This is Rietveld 408576698