| 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 487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 498 | 498 |
| 499 void ContentViewCoreImpl::ConfirmTouchEvent(InputEventAckState ack_result) { | 499 void ContentViewCoreImpl::ConfirmTouchEvent(InputEventAckState ack_result) { |
| 500 JNIEnv* env = AttachCurrentThread(); | 500 JNIEnv* env = AttachCurrentThread(); |
| 501 ScopedJavaLocalRef<jobject> j_obj = java_ref_.get(env); | 501 ScopedJavaLocalRef<jobject> j_obj = java_ref_.get(env); |
| 502 if (j_obj.is_null()) | 502 if (j_obj.is_null()) |
| 503 return; | 503 return; |
| 504 Java_ContentViewCore_confirmTouchEvent(env, j_obj.obj(), | 504 Java_ContentViewCore_confirmTouchEvent(env, j_obj.obj(), |
| 505 static_cast<jint>(ack_result)); | 505 static_cast<jint>(ack_result)); |
| 506 } | 506 } |
| 507 | 507 |
| 508 void ContentViewCoreImpl::UnhandledFlingStartEvent() { | 508 void ContentViewCoreImpl::OnFlingStartEventAck(InputEventAckState ack_result) { |
| 509 JNIEnv* env = AttachCurrentThread(); | 509 JNIEnv* env = AttachCurrentThread(); |
| 510 ScopedJavaLocalRef<jobject> j_obj = java_ref_.get(env); | 510 ScopedJavaLocalRef<jobject> j_obj = java_ref_.get(env); |
| 511 if (j_obj.is_null()) | 511 if (j_obj.is_null()) |
| 512 return; | 512 return; |
| 513 Java_ContentViewCore_unhandledFlingStartEvent(env, j_obj.obj()); | 513 Java_ContentViewCore_onFlingStartEventAck(env, j_obj.obj(), |
| 514 static_cast<jint>(ack_result)); |
| 514 } | 515 } |
| 515 | 516 |
| 516 void ContentViewCoreImpl::OnScrollUpdateGestureConsumed() { | 517 void ContentViewCoreImpl::OnScrollUpdateGestureConsumed() { |
| 517 JNIEnv* env = AttachCurrentThread(); | 518 JNIEnv* env = AttachCurrentThread(); |
| 518 ScopedJavaLocalRef<jobject> j_obj = java_ref_.get(env); | 519 ScopedJavaLocalRef<jobject> j_obj = java_ref_.get(env); |
| 519 if (j_obj.is_null()) | 520 if (j_obj.is_null()) |
| 520 return; | 521 return; |
| 521 Java_ContentViewCore_onScrollUpdateGestureConsumed(env, j_obj.obj()); | 522 Java_ContentViewCore_onScrollUpdateGestureConsumed(env, j_obj.obj()); |
| 522 } | 523 } |
| 523 | 524 |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 671 JNIEnv* env = AttachCurrentThread(); | 672 JNIEnv* env = AttachCurrentThread(); |
| 672 | 673 |
| 673 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); | 674 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); |
| 674 if (obj.is_null()) | 675 if (obj.is_null()) |
| 675 return true; | 676 return true; |
| 676 ScopedJavaLocalRef<jstring> j_url = ConvertUTF8ToJavaString(env, url.spec()); | 677 ScopedJavaLocalRef<jstring> j_url = ConvertUTF8ToJavaString(env, url.spec()); |
| 677 return Java_ContentViewCore_shouldBlockMediaRequest(env, obj.obj(), | 678 return Java_ContentViewCore_shouldBlockMediaRequest(env, obj.obj(), |
| 678 j_url.obj()); | 679 j_url.obj()); |
| 679 } | 680 } |
| 680 | 681 |
| 682 void ContentViewCoreImpl::DidStopFlinging() { |
| 683 JNIEnv* env = AttachCurrentThread(); |
| 684 |
| 685 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); |
| 686 if (!obj.is_null()) |
| 687 Java_ContentViewCore_onNativeFlingStopped(env, obj.obj()); |
| 688 } |
| 689 |
| 681 gfx::Size ContentViewCoreImpl::GetPhysicalBackingSize() const { | 690 gfx::Size ContentViewCoreImpl::GetPhysicalBackingSize() const { |
| 682 JNIEnv* env = AttachCurrentThread(); | 691 JNIEnv* env = AttachCurrentThread(); |
| 683 ScopedJavaLocalRef<jobject> j_obj = java_ref_.get(env); | 692 ScopedJavaLocalRef<jobject> j_obj = java_ref_.get(env); |
| 684 if (j_obj.is_null()) | 693 if (j_obj.is_null()) |
| 685 return gfx::Size(); | 694 return gfx::Size(); |
| 686 return gfx::Size( | 695 return gfx::Size( |
| 687 Java_ContentViewCore_getPhysicalBackingWidthPix(env, j_obj.obj()), | 696 Java_ContentViewCore_getPhysicalBackingWidthPix(env, j_obj.obj()), |
| 688 Java_ContentViewCore_getPhysicalBackingHeightPix(env, j_obj.obj())); | 697 Java_ContentViewCore_getPhysicalBackingHeightPix(env, j_obj.obj())); |
| 689 } | 698 } |
| 690 | 699 |
| (...skipping 991 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1682 reinterpret_cast<ui::ViewAndroid*>(view_android), | 1691 reinterpret_cast<ui::ViewAndroid*>(view_android), |
| 1683 reinterpret_cast<ui::WindowAndroid*>(window_android)); | 1692 reinterpret_cast<ui::WindowAndroid*>(window_android)); |
| 1684 return reinterpret_cast<intptr_t>(view); | 1693 return reinterpret_cast<intptr_t>(view); |
| 1685 } | 1694 } |
| 1686 | 1695 |
| 1687 bool RegisterContentViewCore(JNIEnv* env) { | 1696 bool RegisterContentViewCore(JNIEnv* env) { |
| 1688 return RegisterNativesImpl(env); | 1697 return RegisterNativesImpl(env); |
| 1689 } | 1698 } |
| 1690 | 1699 |
| 1691 } // namespace content | 1700 } // namespace content |
| OLD | NEW |