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

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

Issue 2270323004: Add BlimpView to a Chrome tab when Blimp is enabled. (Closed)
Patch Set: addressed nit, renamed CreateForTesting and piped through touch handling 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.h
diff --git a/blimp/client/core/contents/android/blimp_view.h b/blimp/client/core/contents/android/blimp_view.h
new file mode 100644
index 0000000000000000000000000000000000000000..7df8be4eb28f0ac158500a724c9ef0bf611e048f
--- /dev/null
+++ b/blimp/client/core/contents/android/blimp_view.h
@@ -0,0 +1,86 @@
+// 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.
+
+#ifndef BLIMP_CLIENT_CORE_CONTENTS_ANDROID_BLIMP_VIEW_H_
+#define BLIMP_CLIENT_CORE_CONTENTS_ANDROID_BLIMP_VIEW_H_
+
+#include <jni.h>
+
+#include "base/android/jni_android.h"
+#include "base/android/scoped_java_ref.h"
+
+namespace blimp {
+namespace client {
+
+class BlimpContentsImpl;
+
+// The JNI bridge for the Java BlimpView that will provide hooks to the Android
+// framework to interact with the content. The Java object is created by
+// constructed and owned by the native class.
+class BlimpView {
+ public:
+ static bool RegisterJni(JNIEnv* env);
+
+ // |blimp_contents_impl| must be the BlimpContentsImpl that this BlimpView is
+ // used for.
+ explicit BlimpView(BlimpContentsImpl* blimp_contents_impl);
+ ~BlimpView();
+
+ base::android::ScopedJavaLocalRef<jobject> GetJavaObject();
+
+ // Creates a new ViewAndroidDelegate for this view.
+ base::android::ScopedJavaLocalRef<jobject> CreateViewAndroidDelegate();
+
+ void OnSizeChanged(JNIEnv* env,
+ const base::android::JavaParamRef<jobject>& jobj,
+ jint width,
+ jint height,
+ jfloat device_scale_factor_dp_to_px);
+
+ jboolean OnTouchEvent(
+ JNIEnv* env,
+ const base::android::JavaParamRef<jobject>& obj,
+ const base::android::JavaParamRef<jobject>& motion_event,
+ jlong time_ms,
+ jint android_action,
+ jint pointer_count,
+ jint history_size,
+ jint action_index,
+ jfloat pos_x_0,
+ jfloat pos_y_0,
+ jfloat pos_x_1,
+ jfloat pos_y_1,
+ jint pointer_id_0,
+ jint pointer_id_1,
+ jfloat touch_major_0,
+ jfloat touch_major_1,
+ jfloat touch_minor_0,
+ jfloat touch_minor_1,
+ jfloat orientation_0,
+ jfloat orientation_1,
+ jfloat tilt_0,
+ jfloat tilt_1,
+ jfloat raw_pos_x,
+ jfloat raw_pos_y,
+ jint android_tool_type_0,
+ jint android_tool_type_1,
+ jint android_button_state,
+ jint android_meta_state,
+ jfloat device_scale_factor_dp_to_px);
+
+ private:
+ // The BlimpContentsImpl that this BlimpView is used for.
+ // TODO(nyquist): Use a delegate instead of the BlimpContentsImpl.
+ BlimpContentsImpl* blimp_contents_impl_;
+
+ // The Java object for this BlimpView.
+ base::android::ScopedJavaGlobalRef<jobject> java_obj_;
+
+ DISALLOW_COPY_AND_ASSIGN(BlimpView);
+};
+
+} // namespace client
+} // namespace blimp
+
+#endif // BLIMP_CLIENT_CORE_CONTENTS_ANDROID_BLIMP_VIEW_H_
« no previous file with comments | « blimp/client/core/contents/android/blimp_contents_jni_registrar.cc ('k') | blimp/client/core/contents/android/blimp_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698