| 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 591 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 602 | 602 |
| 603 JNIEnv* env = AttachCurrentThread(); | 603 JNIEnv* env = AttachCurrentThread(); |
| 604 ScopedJavaLocalRef<jobject> j_obj = java_ref_.get(env); | 604 ScopedJavaLocalRef<jobject> j_obj = java_ref_.get(env); |
| 605 if (j_obj.is_null()) | 605 if (j_obj.is_null()) |
| 606 return false; | 606 return false; |
| 607 | 607 |
| 608 const blink::WebGestureEvent& gesture = | 608 const blink::WebGestureEvent& gesture = |
| 609 static_cast<const blink::WebGestureEvent&>(event); | 609 static_cast<const blink::WebGestureEvent&>(event); |
| 610 int gesture_type = ToGestureEventType(event.type); | 610 int gesture_type = ToGestureEventType(event.type); |
| 611 return Java_ContentViewCore_filterTapOrPressEvent(env, j_obj, gesture_type, | 611 return Java_ContentViewCore_filterTapOrPressEvent(env, j_obj, gesture_type, |
| 612 gesture.x * dpi_scale(), | 612 gesture.x, gesture.y); |
| 613 gesture.y * dpi_scale()); | |
| 614 } | 613 } |
| 615 | 614 |
| 616 bool ContentViewCoreImpl::HasFocus() { | 615 bool ContentViewCoreImpl::HasFocus() { |
| 617 JNIEnv* env = AttachCurrentThread(); | 616 JNIEnv* env = AttachCurrentThread(); |
| 618 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); | 617 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); |
| 619 if (obj.is_null()) | 618 if (obj.is_null()) |
| 620 return false; | 619 return false; |
| 621 return Java_ContentViewCore_hasFocus(env, obj); | 620 return Java_ContentViewCore_hasFocus(env, obj); |
| 622 } | 621 } |
| 623 | 622 |
| (...skipping 963 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1587 return ScopedJavaLocalRef<jobject>(); | 1586 return ScopedJavaLocalRef<jobject>(); |
| 1588 | 1587 |
| 1589 return view->GetJavaObject(); | 1588 return view->GetJavaObject(); |
| 1590 } | 1589 } |
| 1591 | 1590 |
| 1592 bool RegisterContentViewCore(JNIEnv* env) { | 1591 bool RegisterContentViewCore(JNIEnv* env) { |
| 1593 return RegisterNativesImpl(env); | 1592 return RegisterNativesImpl(env); |
| 1594 } | 1593 } |
| 1595 | 1594 |
| 1596 } // namespace content | 1595 } // namespace content |
| OLD | NEW |