| 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 664 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 675 ScopedJavaLocalRef<jobject> focus_rect_dip( | 675 ScopedJavaLocalRef<jobject> focus_rect_dip( |
| 676 CreateJavaRect(env, params.focus_rect)); | 676 CreateJavaRect(env, params.focus_rect)); |
| 677 Java_ContentViewCore_onSelectionBoundsChanged(env, obj.obj(), | 677 Java_ContentViewCore_onSelectionBoundsChanged(env, obj.obj(), |
| 678 anchor_rect_dip.obj(), | 678 anchor_rect_dip.obj(), |
| 679 params.anchor_dir, | 679 params.anchor_dir, |
| 680 focus_rect_dip.obj(), | 680 focus_rect_dip.obj(), |
| 681 params.focus_dir, | 681 params.focus_dir, |
| 682 params.is_anchor_first); | 682 params.is_anchor_first); |
| 683 } | 683 } |
| 684 | 684 |
| 685 void ContentViewCoreImpl::OnSelectionRootBoundsChanged( |
| 686 const gfx::Rect& bounds) { |
| 687 JNIEnv* env = AttachCurrentThread(); |
| 688 |
| 689 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); |
| 690 if (obj.is_null()) |
| 691 return; |
| 692 |
| 693 ScopedJavaLocalRef<jobject> rect_object(CreateJavaRect(env, bounds)); |
| 694 Java_ContentViewCore_setSelectionRootBounds(env, |
| 695 obj.obj(), |
| 696 rect_object.obj()); |
| 697 } |
| 698 |
| 685 void ContentViewCoreImpl::ShowPastePopup(int x_dip, int y_dip) { | 699 void ContentViewCoreImpl::ShowPastePopup(int x_dip, int y_dip) { |
| 686 JNIEnv* env = AttachCurrentThread(); | 700 JNIEnv* env = AttachCurrentThread(); |
| 687 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); | 701 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); |
| 688 if (obj.is_null()) | 702 if (obj.is_null()) |
| 689 return; | 703 return; |
| 690 Java_ContentViewCore_showPastePopup(env, obj.obj(), | 704 Java_ContentViewCore_showPastePopup(env, obj.obj(), |
| 691 static_cast<jint>(x_dip), | 705 static_cast<jint>(x_dip), |
| 692 static_cast<jint>(y_dip)); | 706 static_cast<jint>(y_dip)); |
| 693 } | 707 } |
| 694 | 708 |
| (...skipping 1071 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1766 reinterpret_cast<ui::ViewAndroid*>(view_android), | 1780 reinterpret_cast<ui::ViewAndroid*>(view_android), |
| 1767 reinterpret_cast<ui::WindowAndroid*>(window_android)); | 1781 reinterpret_cast<ui::WindowAndroid*>(window_android)); |
| 1768 return reinterpret_cast<intptr_t>(view); | 1782 return reinterpret_cast<intptr_t>(view); |
| 1769 } | 1783 } |
| 1770 | 1784 |
| 1771 bool RegisterContentViewCore(JNIEnv* env) { | 1785 bool RegisterContentViewCore(JNIEnv* env) { |
| 1772 return RegisterNativesImpl(env); | 1786 return RegisterNativesImpl(env); |
| 1773 } | 1787 } |
| 1774 | 1788 |
| 1775 } // namespace content | 1789 } // namespace content |
| OLD | NEW |