OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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 "content/browser/android/content_view_core_impl.h" | 5 #include "content/browser/android/content_view_core_impl.h" |
6 | 6 |
7 #include "base/android/jni_android.h" | 7 #include "base/android/jni_android.h" |
8 #include "base/android/jni_array.h" | 8 #include "base/android/jni_array.h" |
9 #include "base/android/jni_string.h" | 9 #include "base/android/jni_string.h" |
10 #include "base/android/scoped_java_ref.h" | 10 #include "base/android/scoped_java_ref.h" |
(...skipping 665 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
676 | 676 |
677 ScopedJavaLocalRef<jobject> ContentViewCoreImpl::CreateTouchEventSynthesizer() { | 677 ScopedJavaLocalRef<jobject> ContentViewCoreImpl::CreateTouchEventSynthesizer() { |
678 JNIEnv* env = AttachCurrentThread(); | 678 JNIEnv* env = AttachCurrentThread(); |
679 | 679 |
680 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); | 680 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); |
681 if (obj.is_null()) | 681 if (obj.is_null()) |
682 return ScopedJavaLocalRef<jobject>(); | 682 return ScopedJavaLocalRef<jobject>(); |
683 return Java_ContentViewCore_createTouchEventSynthesizer(env, obj.obj()); | 683 return Java_ContentViewCore_createTouchEventSynthesizer(env, obj.obj()); |
684 } | 684 } |
685 | 685 |
686 ScopedJavaLocalRef<jobject> ContentViewCoreImpl::GetContentVideoViewClient() { | |
687 JNIEnv* env = AttachCurrentThread(); | |
688 | |
689 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); | |
690 if (obj.is_null()) | |
691 return ScopedJavaLocalRef<jobject>(); | |
692 | |
693 return Java_ContentViewCore_getContentVideoViewClient(env, obj.obj()); | |
694 } | |
695 | |
696 ScopedJavaLocalRef<jobject> ContentViewCoreImpl::GetContext() { | |
697 JNIEnv* env = AttachCurrentThread(); | |
698 | |
699 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); | |
700 if (obj.is_null()) | |
701 return ScopedJavaLocalRef<jobject>(); | |
702 | |
703 return Java_ContentViewCore_getContext(env, obj.obj()); | |
704 } | |
705 | |
706 bool ContentViewCoreImpl::ShouldBlockMediaRequest(const GURL& url) { | 686 bool ContentViewCoreImpl::ShouldBlockMediaRequest(const GURL& url) { |
707 JNIEnv* env = AttachCurrentThread(); | 687 JNIEnv* env = AttachCurrentThread(); |
708 | 688 |
709 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); | 689 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); |
710 if (obj.is_null()) | 690 if (obj.is_null()) |
711 return true; | 691 return true; |
712 ScopedJavaLocalRef<jstring> j_url = ConvertUTF8ToJavaString(env, url.spec()); | 692 ScopedJavaLocalRef<jstring> j_url = ConvertUTF8ToJavaString(env, url.spec()); |
713 return Java_ContentViewCore_shouldBlockMediaRequest(env, obj.obj(), | 693 return Java_ContentViewCore_shouldBlockMediaRequest(env, obj.obj(), |
714 j_url.obj()); | 694 j_url.obj()); |
715 } | 695 } |
(...skipping 622 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1338 reinterpret_cast<ui::WindowAndroid*>(window_android), | 1318 reinterpret_cast<ui::WindowAndroid*>(window_android), |
1339 retained_objects_set); | 1319 retained_objects_set); |
1340 return reinterpret_cast<intptr_t>(view); | 1320 return reinterpret_cast<intptr_t>(view); |
1341 } | 1321 } |
1342 | 1322 |
1343 bool RegisterContentViewCore(JNIEnv* env) { | 1323 bool RegisterContentViewCore(JNIEnv* env) { |
1344 return RegisterNativesImpl(env); | 1324 return RegisterNativesImpl(env); |
1345 } | 1325 } |
1346 | 1326 |
1347 } // namespace content | 1327 } // namespace content |
OLD | NEW |