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 580 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
591 ScopedJavaLocalRef<jobject> java_bitmap = | 591 ScopedJavaLocalRef<jobject> java_bitmap = |
592 gfx::ConvertToJavaBitmap(&zoomed_bitmap); | 592 gfx::ConvertToJavaBitmap(&zoomed_bitmap); |
593 DCHECK(!java_bitmap.is_null()); | 593 DCHECK(!java_bitmap.is_null()); |
594 | 594 |
595 Java_ContentViewCore_showDisambiguationPopup(env, | 595 Java_ContentViewCore_showDisambiguationPopup(env, |
596 obj.obj(), | 596 obj.obj(), |
597 rect_object.obj(), | 597 rect_object.obj(), |
598 java_bitmap.obj()); | 598 java_bitmap.obj()); |
599 } | 599 } |
600 | 600 |
| 601 ScopedJavaLocalRef<jobject> ContentViewCoreImpl::CreateTouchEventSynthesizer() { |
| 602 JNIEnv* env = AttachCurrentThread(); |
| 603 |
| 604 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); |
| 605 if (obj.is_null()) |
| 606 return ScopedJavaLocalRef<jobject>(); |
| 607 return Java_ContentViewCore_createTouchEventSynthesizer(env, obj.obj()); |
| 608 } |
| 609 |
601 ScopedJavaLocalRef<jobject> ContentViewCoreImpl::CreateOnePointTouchGesture( | 610 ScopedJavaLocalRef<jobject> ContentViewCoreImpl::CreateOnePointTouchGesture( |
602 int32 start_x, int32 start_y, int32 delta_x, int32 delta_y) { | 611 int32 start_x, int32 start_y, int32 delta_x, int32 delta_y) { |
603 JNIEnv* env = AttachCurrentThread(); | 612 JNIEnv* env = AttachCurrentThread(); |
604 | 613 |
605 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); | 614 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); |
606 if (obj.is_null()) | 615 if (obj.is_null()) |
607 return ScopedJavaLocalRef<jobject>(); | 616 return ScopedJavaLocalRef<jobject>(); |
608 return Java_ContentViewCore_createOnePointTouchGesture( | 617 return Java_ContentViewCore_createOnePointTouchGesture( |
609 env, obj.obj(), start_x, start_y, delta_x, delta_y); | 618 env, obj.obj(), start_x, start_y, delta_x, delta_y); |
610 } | 619 } |
(...skipping 1031 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1642 reinterpret_cast<ui::ViewAndroid*>(view_android), | 1651 reinterpret_cast<ui::ViewAndroid*>(view_android), |
1643 reinterpret_cast<ui::WindowAndroid*>(window_android)); | 1652 reinterpret_cast<ui::WindowAndroid*>(window_android)); |
1644 return reinterpret_cast<jint>(view); | 1653 return reinterpret_cast<jint>(view); |
1645 } | 1654 } |
1646 | 1655 |
1647 bool RegisterContentViewCore(JNIEnv* env) { | 1656 bool RegisterContentViewCore(JNIEnv* env) { |
1648 return RegisterNativesImpl(env); | 1657 return RegisterNativesImpl(env); |
1649 } | 1658 } |
1650 | 1659 |
1651 } // namespace content | 1660 } // namespace content |
OLD | NEW |