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" |
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 return Java_WindowAndroid_canRequestPermission( | 271 return Java_WindowAndroid_canRequestPermission( |
272 env, GetJavaObject(), | 272 env, GetJavaObject(), |
273 base::android::ConvertUTF8ToJavaString(env, permission)); | 273 base::android::ConvertUTF8ToJavaString(env, permission)); |
274 } | 274 } |
275 | 275 |
276 WindowAndroid* WindowAndroid::GetWindowAndroid() const { | 276 WindowAndroid* WindowAndroid::GetWindowAndroid() const { |
277 DCHECK(parent_ == nullptr); | 277 DCHECK(parent_ == nullptr); |
278 return const_cast<WindowAndroid*>(this); | 278 return const_cast<WindowAndroid*>(this); |
279 } | 279 } |
280 | 280 |
| 281 ScopedJavaLocalRef<jobject> WindowAndroid::GetWindowToken() { |
| 282 JNIEnv* env = AttachCurrentThread(); |
| 283 return Java_WindowAndroid_getWindowToken(env, GetJavaObject()); |
| 284 } |
| 285 |
281 // ---------------------------------------------------------------------------- | 286 // ---------------------------------------------------------------------------- |
282 // Native JNI methods | 287 // Native JNI methods |
283 // ---------------------------------------------------------------------------- | 288 // ---------------------------------------------------------------------------- |
284 | 289 |
285 jlong Init(JNIEnv* env, const JavaParamRef<jobject>& obj, int sdk_display_id) { | 290 jlong Init(JNIEnv* env, const JavaParamRef<jobject>& obj, int sdk_display_id) { |
286 WindowAndroid* window = new WindowAndroid(env, obj, sdk_display_id); | 291 WindowAndroid* window = new WindowAndroid(env, obj, sdk_display_id); |
287 return reinterpret_cast<intptr_t>(window); | 292 return reinterpret_cast<intptr_t>(window); |
288 } | 293 } |
289 | 294 |
290 } // namespace ui | 295 } // namespace ui |
OLD | NEW |