Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(237)

Side by Side Diff: content/browser/android/content_view_core_impl.cc

Issue 188023002: Android-side of insertion/selection handles visibility. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixed comments + rebased Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « content/browser/android/content_view_core_impl.h ('k') | content/browser/renderer_host/render_widget_host_view_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698