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

Unified Diff: content/browser/android/content_view_core_impl.cc

Issue 300323005: Route selection bounds updates through the compositor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Defer selection updates until after compositor scheduling Created 6 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/android/content_view_core_impl.cc
diff --git a/content/browser/android/content_view_core_impl.cc b/content/browser/android/content_view_core_impl.cc
index 9f74b84ea1e282adc42c8e7e8e172918c4b22d4c..77cb1db037668784a87ab94f40c1dac7d7375734 100644
--- a/content/browser/android/content_view_core_impl.cc
+++ b/content/browser/android/content_view_core_impl.cc
@@ -600,22 +600,26 @@ void ContentViewCoreImpl::OnSelectionChanged(const std::string& text) {
Java_ContentViewCore_onSelectionChanged(env, obj.obj(), jtext.obj());
}
-void ContentViewCoreImpl::OnSelectionBoundsChanged(
- const ViewHostMsg_SelectionBounds_Params& params) {
+void ContentViewCoreImpl::OnSelectionBoundsChanged(const gfx::PointF& anchor,
+ const gfx::PointF& focus,
+ int anchor_dir,
+ int focus_dir,
+ bool is_anchor_visible,
+ bool is_focus_visible) {
JNIEnv* env = AttachCurrentThread();
ScopedJavaLocalRef<jobject> obj = java_ref_.get(env);
if (obj.is_null())
return;
- ScopedJavaLocalRef<jobject> anchor_rect_dip(
- CreateJavaRect(env, params.anchor_rect));
- ScopedJavaLocalRef<jobject> focus_rect_dip(
- CreateJavaRect(env, params.focus_rect));
- Java_ContentViewCore_onSelectionBoundsChanged(env, obj.obj(),
- anchor_rect_dip.obj(),
- params.anchor_dir,
- focus_rect_dip.obj(),
- params.focus_dir,
- params.is_anchor_first);
+ Java_ContentViewCore_onSelectionBoundsChanged(env,
+ obj.obj(),
+ anchor.x(),
+ anchor.y(),
+ focus.x(),
+ focus.y(),
+ anchor_dir,
+ focus_dir,
+ is_anchor_visible,
+ is_focus_visible);
}
void ContentViewCoreImpl::ShowPastePopup(int x_dip, int y_dip) {

Powered by Google App Engine
This is Rietveld 408576698