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 660 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
671 JNIEnv* env = AttachCurrentThread(); | 671 JNIEnv* env = AttachCurrentThread(); |
672 | 672 |
673 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); | 673 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); |
674 if (obj.is_null()) | 674 if (obj.is_null()) |
675 return true; | 675 return true; |
676 ScopedJavaLocalRef<jstring> j_url = ConvertUTF8ToJavaString(env, url.spec()); | 676 ScopedJavaLocalRef<jstring> j_url = ConvertUTF8ToJavaString(env, url.spec()); |
677 return Java_ContentViewCore_shouldBlockMediaRequest(env, obj.obj(), | 677 return Java_ContentViewCore_shouldBlockMediaRequest(env, obj.obj(), |
678 j_url.obj()); | 678 j_url.obj()); |
679 } | 679 } |
680 | 680 |
| 681 void ContentViewCoreImpl::DidStopFlinging() { |
| 682 JNIEnv* env = AttachCurrentThread(); |
| 683 |
| 684 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); |
| 685 if (!obj.is_null()) |
| 686 Java_ContentViewCore_onNativeFlingStopped(env, obj.obj()); |
| 687 } |
| 688 |
681 gfx::Size ContentViewCoreImpl::GetPhysicalBackingSize() const { | 689 gfx::Size ContentViewCoreImpl::GetPhysicalBackingSize() const { |
682 JNIEnv* env = AttachCurrentThread(); | 690 JNIEnv* env = AttachCurrentThread(); |
683 ScopedJavaLocalRef<jobject> j_obj = java_ref_.get(env); | 691 ScopedJavaLocalRef<jobject> j_obj = java_ref_.get(env); |
684 if (j_obj.is_null()) | 692 if (j_obj.is_null()) |
685 return gfx::Size(); | 693 return gfx::Size(); |
686 return gfx::Size( | 694 return gfx::Size( |
687 Java_ContentViewCore_getPhysicalBackingWidthPix(env, j_obj.obj()), | 695 Java_ContentViewCore_getPhysicalBackingWidthPix(env, j_obj.obj()), |
688 Java_ContentViewCore_getPhysicalBackingHeightPix(env, j_obj.obj())); | 696 Java_ContentViewCore_getPhysicalBackingHeightPix(env, j_obj.obj())); |
689 } | 697 } |
690 | 698 |
(...skipping 991 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1682 reinterpret_cast<ui::ViewAndroid*>(view_android), | 1690 reinterpret_cast<ui::ViewAndroid*>(view_android), |
1683 reinterpret_cast<ui::WindowAndroid*>(window_android)); | 1691 reinterpret_cast<ui::WindowAndroid*>(window_android)); |
1684 return reinterpret_cast<intptr_t>(view); | 1692 return reinterpret_cast<intptr_t>(view); |
1685 } | 1693 } |
1686 | 1694 |
1687 bool RegisterContentViewCore(JNIEnv* env) { | 1695 bool RegisterContentViewCore(JNIEnv* env) { |
1688 return RegisterNativesImpl(env); | 1696 return RegisterNativesImpl(env); |
1689 } | 1697 } |
1690 | 1698 |
1691 } // namespace content | 1699 } // namespace content |
OLD | NEW |