Chromium Code Reviews| 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 523 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 534 if (ack_result == INPUT_EVENT_ACK_STATE_CONSUMED) | 534 if (ack_result == INPUT_EVENT_ACK_STATE_CONSUMED) |
| 535 Java_ContentViewCore_performLongPressHapticFeedback(env, j_obj); | 535 Java_ContentViewCore_performLongPressHapticFeedback(env, j_obj); |
| 536 break; | 536 break; |
| 537 default: | 537 default: |
| 538 break; | 538 break; |
| 539 } | 539 } |
| 540 } | 540 } |
| 541 | 541 |
| 542 bool ContentViewCoreImpl::FilterInputEvent(const blink::WebInputEvent& event) { | 542 bool ContentViewCoreImpl::FilterInputEvent(const blink::WebInputEvent& event) { |
| 543 if (event.GetType() != WebInputEvent::kGestureTap && | 543 if (event.GetType() != WebInputEvent::kGestureTap && |
| 544 event.GetType() != WebInputEvent::kGestureDoubleTap && | |
| 545 event.GetType() != WebInputEvent::kGestureLongTap && | 544 event.GetType() != WebInputEvent::kGestureLongTap && |
| 546 event.GetType() != WebInputEvent::kGestureLongPress) | 545 event.GetType() != WebInputEvent::kGestureLongPress && |
| 546 event.GetType() != WebInputEvent::kMouseDown) | |
| 547 return false; | 547 return false; |
| 548 | 548 |
| 549 JNIEnv* env = AttachCurrentThread(); | 549 JNIEnv* env = AttachCurrentThread(); |
| 550 ScopedJavaLocalRef<jobject> j_obj = java_ref_.get(env); | 550 ScopedJavaLocalRef<jobject> j_obj = java_ref_.get(env); |
| 551 if (j_obj.is_null()) | 551 if (j_obj.is_null()) |
| 552 return false; | 552 return false; |
| 553 | 553 |
| 554 Java_ContentViewCore_requestFocus(env, j_obj); | |
|
aelias_OOO_until_Jul13
2017/06/13 22:22:55
This doesn't really have anything to do with filte
aelias_OOO_until_Jul13
2017/06/15 22:14:30
OK, Pedro explained offline this approach doesn't
| |
| 555 | |
| 556 if (event.GetType() == WebInputEvent::kMouseDown) | |
| 557 return false; | |
| 558 | |
| 554 const blink::WebGestureEvent& gesture = | 559 const blink::WebGestureEvent& gesture = |
| 555 static_cast<const blink::WebGestureEvent&>(event); | 560 static_cast<const blink::WebGestureEvent&>(event); |
| 556 int gesture_type = ToGestureEventType(event.GetType()); | 561 int gesture_type = ToGestureEventType(event.GetType()); |
| 557 return Java_ContentViewCore_filterTapOrPressEvent(env, j_obj, gesture_type, | 562 return Java_ContentViewCore_filterTapOrPressEvent(env, j_obj, gesture_type, |
| 558 gesture.x * dpi_scale(), | 563 gesture.x * dpi_scale(), |
| 559 gesture.y * dpi_scale()); | 564 gesture.y * dpi_scale()); |
| 560 } | 565 } |
| 561 | 566 |
| 562 bool ContentViewCoreImpl::HasFocus() { | 567 bool ContentViewCoreImpl::HasFocus() { |
| 563 JNIEnv* env = AttachCurrentThread(); | 568 JNIEnv* env = AttachCurrentThread(); |
| (...skipping 665 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1229 return ScopedJavaLocalRef<jobject>(); | 1234 return ScopedJavaLocalRef<jobject>(); |
| 1230 | 1235 |
| 1231 return view->GetJavaObject(); | 1236 return view->GetJavaObject(); |
| 1232 } | 1237 } |
| 1233 | 1238 |
| 1234 bool RegisterContentViewCore(JNIEnv* env) { | 1239 bool RegisterContentViewCore(JNIEnv* env) { |
| 1235 return RegisterNativesImpl(env); | 1240 return RegisterNativesImpl(env); |
| 1236 } | 1241 } |
| 1237 | 1242 |
| 1238 } // namespace content | 1243 } // namespace content |
| OLD | NEW |