Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | |
|
nilesh
2013/04/12 19:07:10
2013
aurimas (slooooooooow)
2013/04/12 22:00:41
Done.
| |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef UI_VIEW_ANDROID_H_ | |
|
nilesh
2013/04/12 19:07:10
UI_ANDROID_VIEW_ANDROID_H
aurimas (slooooooooow)
2013/04/12 22:00:41
Done.
| |
| 6 #define UI_VIEW_ANDROID_H_ | |
| 7 | |
| 8 #include <jni.h> | |
| 9 #include "base/android/jni_helper.h" | |
| 10 #include "base/android/scoped_java_ref.h" | |
| 11 | |
| 12 namespace ui { | |
| 13 | |
| 14 class WindowAndroid; | |
| 15 | |
| 16 // This class deals with the Android native window ref count. | |
|
joth
2013/04/12 19:00:48
i"m not sure what ref count that is?
aurimas (slooooooooow)
2013/04/12 22:00:41
Done.
| |
| 17 class ViewAndroid { | |
|
joth
2013/04/12 19:00:48
Can we get the java and native class names consist
aurimas (slooooooooow)
2013/04/12 22:00:41
Done.
| |
| 18 public: | |
| 19 ViewAndroid(JNIEnv* env, jobject obj, WindowAndroid* window); | |
|
joth
2013/04/12 19:00:48
what's the lifetime relationship of |window| ? it
aurimas (slooooooooow)
2013/04/12 22:00:41
WindowAndroid has a life time of the application.
joth
2013/04/16 04:02:42
I see.
nit: I think you mean activity, not applic
| |
| 20 | |
| 21 void Destroy(JNIEnv* env, jobject obj); | |
| 22 | |
| 23 WindowAndroid* GetWindowAndroid(); | |
| 24 | |
| 25 base::android::ScopedJavaLocalRef<jobject> GetJavaObject(); | |
|
joth
2013/04/12 19:00:48
note - will return NULL if the java side was GCed
aurimas (slooooooooow)
2013/04/12 22:00:41
How can I fix this? Add null checks?
joth
2013/04/16 04:02:42
yeah.. we basically get this pattern that any time
| |
| 26 | |
| 27 static bool RegisterViewAndroid(JNIEnv* env); | |
| 28 | |
| 29 private: | |
| 30 ~ViewAndroid(); | |
| 31 JavaObjectWeakGlobalRef weak_java_view_; | |
| 32 WindowAndroid* window_android_; | |
| 33 | |
| 34 DISALLOW_COPY_AND_ASSIGN(ViewAndroid); | |
| 35 }; | |
| 36 | |
| 37 } // namespace ui | |
| 38 | |
| 39 #endif // UI_VIEW_ANDROID_H_ | |
| OLD | NEW |