OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #include "ui/android/window_android.h" | 5 #include "ui/android/window_android.h" |
6 | 6 |
7 #include "base/android/context_utils.h" | 7 #include "base/android/context_utils.h" |
8 #include "base/android/jni_android.h" | 8 #include "base/android/jni_android.h" |
9 #include "base/android/jni_array.h" | 9 #include "base/android/jni_array.h" |
10 #include "base/android/jni_string.h" | 10 #include "base/android/jni_string.h" |
11 #include "base/android/jni_weak_ref.h" | 11 #include "base/android/jni_weak_ref.h" |
12 #include "base/android/scoped_java_ref.h" | 12 #include "base/android/scoped_java_ref.h" |
13 #include "jni/WindowAndroid_jni.h" | 13 #include "jni/WindowAndroid_jni.h" |
14 #include "ui/android/window_android_compositor.h" | 14 #include "ui/android/window_android_compositor.h" |
15 #include "ui/android/window_android_observer.h" | 15 #include "ui/android/window_android_observer.h" |
16 | 16 |
17 namespace ui { | 17 namespace ui { |
18 | 18 |
19 using base::android::AttachCurrentThread; | 19 using base::android::AttachCurrentThread; |
| 20 using base::android::JavaParamRef; |
20 using base::android::JavaRef; | 21 using base::android::JavaRef; |
21 using base::android::ScopedJavaLocalRef; | 22 using base::android::ScopedJavaLocalRef; |
22 | 23 |
23 WindowAndroid::WindowAndroid(JNIEnv* env, jobject obj) : compositor_(NULL) { | 24 WindowAndroid::WindowAndroid(JNIEnv* env, jobject obj) : compositor_(NULL) { |
24 java_window_.Reset(env, obj); | 25 java_window_.Reset(env, obj); |
25 } | 26 } |
26 | 27 |
27 void WindowAndroid::Destroy(JNIEnv* env, const JavaParamRef<jobject>& obj) { | 28 void WindowAndroid::Destroy(JNIEnv* env, const JavaParamRef<jobject>& obj) { |
28 delete this; | 29 delete this; |
29 } | 30 } |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 // ---------------------------------------------------------------------------- | 163 // ---------------------------------------------------------------------------- |
163 // Native JNI methods | 164 // Native JNI methods |
164 // ---------------------------------------------------------------------------- | 165 // ---------------------------------------------------------------------------- |
165 | 166 |
166 jlong Init(JNIEnv* env, const JavaParamRef<jobject>& obj) { | 167 jlong Init(JNIEnv* env, const JavaParamRef<jobject>& obj) { |
167 WindowAndroid* window = new WindowAndroid(env, obj); | 168 WindowAndroid* window = new WindowAndroid(env, obj); |
168 return reinterpret_cast<intptr_t>(window); | 169 return reinterpret_cast<intptr_t>(window); |
169 } | 170 } |
170 | 171 |
171 } // namespace ui | 172 } // namespace ui |
OLD | NEW |