| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/android/jni_android.h" | 9 #include "base/android/jni_android.h" |
| 10 #include "base/android/jni_array.h" | 10 #include "base/android/jni_array.h" |
| (...skipping 689 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 700 ScopedJavaLocalRef<jobject> | 700 ScopedJavaLocalRef<jobject> |
| 701 ContentViewCoreImpl::CreateMotionEventSynthesizer() { | 701 ContentViewCoreImpl::CreateMotionEventSynthesizer() { |
| 702 JNIEnv* env = AttachCurrentThread(); | 702 JNIEnv* env = AttachCurrentThread(); |
| 703 | 703 |
| 704 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); | 704 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); |
| 705 if (obj.is_null()) | 705 if (obj.is_null()) |
| 706 return ScopedJavaLocalRef<jobject>(); | 706 return ScopedJavaLocalRef<jobject>(); |
| 707 return Java_ContentViewCore_createMotionEventSynthesizer(env, obj); | 707 return Java_ContentViewCore_createMotionEventSynthesizer(env, obj); |
| 708 } | 708 } |
| 709 | 709 |
| 710 bool ContentViewCoreImpl::ShouldBlockMediaRequest(const GURL& url) { | |
| 711 JNIEnv* env = AttachCurrentThread(); | |
| 712 | |
| 713 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); | |
| 714 if (obj.is_null()) | |
| 715 return true; | |
| 716 ScopedJavaLocalRef<jstring> j_url = ConvertUTF8ToJavaString(env, url.spec()); | |
| 717 return Java_ContentViewCore_shouldBlockMediaRequest(env, obj, j_url); | |
| 718 } | |
| 719 | |
| 720 void ContentViewCoreImpl::DidStopFlinging() { | 710 void ContentViewCoreImpl::DidStopFlinging() { |
| 721 JNIEnv* env = AttachCurrentThread(); | 711 JNIEnv* env = AttachCurrentThread(); |
| 722 | 712 |
| 723 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); | 713 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); |
| 724 if (!obj.is_null()) | 714 if (!obj.is_null()) |
| 725 Java_ContentViewCore_onNativeFlingStopped(env, obj); | 715 Java_ContentViewCore_onNativeFlingStopped(env, obj); |
| 726 } | 716 } |
| 727 | 717 |
| 728 ScopedJavaLocalRef<jobject> ContentViewCoreImpl::GetContext() const { | 718 ScopedJavaLocalRef<jobject> ContentViewCoreImpl::GetContext() const { |
| 729 JNIEnv* env = AttachCurrentThread(); | 719 JNIEnv* env = AttachCurrentThread(); |
| (...skipping 857 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1587 return ScopedJavaLocalRef<jobject>(); | 1577 return ScopedJavaLocalRef<jobject>(); |
| 1588 | 1578 |
| 1589 return view->GetJavaObject(); | 1579 return view->GetJavaObject(); |
| 1590 } | 1580 } |
| 1591 | 1581 |
| 1592 bool RegisterContentViewCore(JNIEnv* env) { | 1582 bool RegisterContentViewCore(JNIEnv* env) { |
| 1593 return RegisterNativesImpl(env); | 1583 return RegisterNativesImpl(env); |
| 1594 } | 1584 } |
| 1595 | 1585 |
| 1596 } // namespace content | 1586 } // namespace content |
| OLD | NEW |