Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef BLIMP_CLIENT_CORE_CONTENTS_ANDROID_BLIMP_VIEW_H_ | 5 #ifndef BLIMP_CLIENT_CORE_CONTENTS_ANDROID_BLIMP_VIEW_H_ |
| 6 #define BLIMP_CLIENT_CORE_CONTENTS_ANDROID_BLIMP_VIEW_H_ | 6 #define BLIMP_CLIENT_CORE_CONTENTS_ANDROID_BLIMP_VIEW_H_ |
| 7 | 7 |
| 8 #include <jni.h> | 8 #include <jni.h> |
| 9 | 9 |
| 10 #include "base/android/jni_android.h" | 10 #include "base/android/jni_android.h" |
| 11 #include "base/android/scoped_java_ref.h" | 11 #include "base/android/scoped_java_ref.h" |
| 12 | 12 |
| 13 namespace ui { | |
| 14 class WindowAndroid; | |
| 15 } // namespace ui | |
| 16 | |
| 13 namespace blimp { | 17 namespace blimp { |
| 14 namespace client { | 18 namespace client { |
| 15 | 19 |
| 16 class BlimpContentsImpl; | 20 class BlimpContentsViewImpl; |
| 17 | 21 |
| 18 // The JNI bridge for the Java BlimpView that will provide hooks to the Android | 22 // The JNI bridge for the Java BlimpView that will provide hooks to the Android |
| 19 // framework to interact with the content. The Java object is created by | 23 // framework to interact with the content. The Java object is created by |
| 20 // constructed and owned by the native class. | 24 // constructed and owned by the native class. |
| 21 class BlimpView { | 25 class BlimpView { |
| 22 public: | 26 public: |
| 23 static bool RegisterJni(JNIEnv* env); | 27 static bool RegisterJni(JNIEnv* env); |
| 24 | 28 |
| 25 // |blimp_contents_impl| must be the BlimpContentsImpl that this BlimpView is | 29 // |blimp_contents_view| must be the BlimpContentsView that owns this |
| 26 // used for. | 30 // BlimpView. |window| should also be the WindowAndroid that the |
| 27 explicit BlimpView(BlimpContentsImpl* blimp_contents_impl); | 31 // corresponding BlimpContents was created with. |
| 32 explicit BlimpView(ui::WindowAndroid* window, | |
| 33 BlimpContentsViewImpl* blimp_contents_view); | |
| 28 ~BlimpView(); | 34 ~BlimpView(); |
| 29 | 35 |
| 30 base::android::ScopedJavaLocalRef<jobject> GetJavaObject(); | 36 base::android::ScopedJavaLocalRef<jobject> GetJavaObject(); |
| 31 | 37 |
| 32 // Creates a new ViewAndroidDelegate for this view. | 38 // Creates a new ViewAndroidDelegate for this view. |
| 33 base::android::ScopedJavaLocalRef<jobject> CreateViewAndroidDelegate(); | 39 base::android::ScopedJavaLocalRef<jobject> CreateViewAndroidDelegate(); |
| 34 | 40 |
| 35 void OnSizeChanged(JNIEnv* env, | 41 void OnSizeChanged(JNIEnv* env, |
| 36 const base::android::JavaParamRef<jobject>& jobj, | 42 const base::android::JavaParamRef<jobject>& jobj, |
| 37 jint width, | 43 jint width, |
| (...skipping 25 matching lines...) Expand all Loading... | |
| 63 jfloat tilt_1, | 69 jfloat tilt_1, |
| 64 jfloat raw_pos_x, | 70 jfloat raw_pos_x, |
| 65 jfloat raw_pos_y, | 71 jfloat raw_pos_y, |
| 66 jint android_tool_type_0, | 72 jint android_tool_type_0, |
| 67 jint android_tool_type_1, | 73 jint android_tool_type_1, |
| 68 jint android_button_state, | 74 jint android_button_state, |
| 69 jint android_meta_state, | 75 jint android_meta_state, |
| 70 jfloat device_scale_factor_dp_to_px); | 76 jfloat device_scale_factor_dp_to_px); |
| 71 | 77 |
| 72 private: | 78 private: |
| 73 // The BlimpContentsImpl that this BlimpView is used for. | 79 // UPDATE COMMENT The BlimpContentsImpl that this BlimpView is used for. |
|
Khushal
2016/09/13 04:47:24
That's a good idea. :P
David Trainor- moved to gerrit
2016/09/13 06:18:04
;)
| |
| 74 // TODO(nyquist): Use a delegate instead of the BlimpContentsImpl. | 80 // TODO(nyquist): Use a delegate instead of the BlimpContentsImpl. |
| 75 BlimpContentsImpl* blimp_contents_impl_; | 81 BlimpContentsViewImpl* blimp_contents_view_; |
| 76 | 82 |
| 77 // The Java object for this BlimpView. | 83 // The Java object for this BlimpView. |
| 78 base::android::ScopedJavaGlobalRef<jobject> java_obj_; | 84 base::android::ScopedJavaGlobalRef<jobject> java_obj_; |
| 79 | 85 |
| 80 DISALLOW_COPY_AND_ASSIGN(BlimpView); | 86 DISALLOW_COPY_AND_ASSIGN(BlimpView); |
| 81 }; | 87 }; |
| 82 | 88 |
| 83 } // namespace client | 89 } // namespace client |
| 84 } // namespace blimp | 90 } // namespace blimp |
| 85 | 91 |
| 86 #endif // BLIMP_CLIENT_CORE_CONTENTS_ANDROID_BLIMP_VIEW_H_ | 92 #endif // BLIMP_CLIENT_CORE_CONTENTS_ANDROID_BLIMP_VIEW_H_ |
| OLD | NEW |