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 479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
490 env->SetIntArrayRegion(enabled_array.obj(), i, 1, &enabled); | 490 env->SetIntArrayRegion(enabled_array.obj(), i, 1, &enabled); |
491 } | 491 } |
492 ScopedJavaLocalRef<jobjectArray> items_array( | 492 ScopedJavaLocalRef<jobjectArray> items_array( |
493 base::android::ToJavaArrayOfStrings(env, labels)); | 493 base::android::ToJavaArrayOfStrings(env, labels)); |
494 Java_ContentViewCore_showSelectPopup(env, j_obj.obj(), | 494 Java_ContentViewCore_showSelectPopup(env, j_obj.obj(), |
495 items_array.obj(), enabled_array.obj(), | 495 items_array.obj(), enabled_array.obj(), |
496 multiple, selected_array.obj()); | 496 multiple, selected_array.obj()); |
497 } | 497 } |
498 | 498 |
499 void ContentViewCoreImpl::ConfirmTouchEvent(InputEventAckState ack_result) { | 499 void ContentViewCoreImpl::ConfirmTouchEvent(InputEventAckState ack_result) { |
| 500 LOG(ERROR) << "CVCI::ConfirmTouchEvent"; |
500 JNIEnv* env = AttachCurrentThread(); | 501 JNIEnv* env = AttachCurrentThread(); |
501 ScopedJavaLocalRef<jobject> j_obj = java_ref_.get(env); | 502 ScopedJavaLocalRef<jobject> j_obj = java_ref_.get(env); |
502 if (j_obj.is_null()) | 503 if (j_obj.is_null()) |
503 return; | 504 return; |
504 Java_ContentViewCore_confirmTouchEvent(env, j_obj.obj(), | 505 Java_ContentViewCore_confirmTouchEvent(env, j_obj.obj(), |
505 static_cast<jint>(ack_result)); | 506 static_cast<jint>(ack_result)); |
506 } | 507 } |
507 | 508 |
508 void ContentViewCoreImpl::UnhandledFlingStartEvent() { | 509 void ContentViewCoreImpl::UnhandledFlingStartEvent() { |
509 JNIEnv* env = AttachCurrentThread(); | 510 JNIEnv* env = AttachCurrentThread(); |
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
894 device_orientation_ = orientation; | 895 device_orientation_ = orientation; |
895 SendOrientationChangeEventInternal(); | 896 SendOrientationChangeEventInternal(); |
896 } | 897 } |
897 } | 898 } |
898 | 899 |
899 jboolean ContentViewCoreImpl::SendTouchEvent(JNIEnv* env, | 900 jboolean ContentViewCoreImpl::SendTouchEvent(JNIEnv* env, |
900 jobject obj, | 901 jobject obj, |
901 jlong time_ms, | 902 jlong time_ms, |
902 jint type, | 903 jint type, |
903 jobjectArray pts) { | 904 jobjectArray pts) { |
| 905 LOG(ERROR) << "SendTouchEvent"; |
904 RenderWidgetHostViewAndroid* rwhv = GetRenderWidgetHostViewAndroid(); | 906 RenderWidgetHostViewAndroid* rwhv = GetRenderWidgetHostViewAndroid(); |
905 if (rwhv) { | 907 if (rwhv) { |
906 using blink::WebTouchEvent; | 908 using blink::WebTouchEvent; |
907 blink::WebTouchEvent event; | 909 blink::WebTouchEvent event; |
908 TouchPoint::BuildWebTouchEvent(env, type, time_ms, GetDpiScale(), pts, | 910 TouchPoint::BuildWebTouchEvent(env, type, time_ms, GetDpiScale(), pts, |
909 event); | 911 event); |
910 rwhv->SendTouchEvent(event); | 912 rwhv->SendTouchEvent(event); |
911 return true; | 913 return true; |
912 } | 914 } |
913 return false; | 915 return false; |
(...skipping 768 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1682 reinterpret_cast<ui::ViewAndroid*>(view_android), | 1684 reinterpret_cast<ui::ViewAndroid*>(view_android), |
1683 reinterpret_cast<ui::WindowAndroid*>(window_android)); | 1685 reinterpret_cast<ui::WindowAndroid*>(window_android)); |
1684 return reinterpret_cast<intptr_t>(view); | 1686 return reinterpret_cast<intptr_t>(view); |
1685 } | 1687 } |
1686 | 1688 |
1687 bool RegisterContentViewCore(JNIEnv* env) { | 1689 bool RegisterContentViewCore(JNIEnv* env) { |
1688 return RegisterNativesImpl(env); | 1690 return RegisterNativesImpl(env); |
1689 } | 1691 } |
1690 | 1692 |
1691 } // namespace content | 1693 } // namespace content |
OLD | NEW |