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

Unified Diff: content/browser/renderer_host/render_widget_host_view_android.cc

Issue 699333003: Support InputMethodManager#updateCursorAnchorInfo for Android 5.0 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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/renderer_host/render_widget_host_view_android.cc
diff --git a/content/browser/renderer_host/render_widget_host_view_android.cc b/content/browser/renderer_host/render_widget_host_view_android.cc
index 3a2dc883f4031ea824c2b2088f2d1ecfceae9ecb..8b47a319db12d6008e5e0894dbbb56afa37d54eb 100644
--- a/content/browser/renderer_host/render_widget_host_view_android.cc
+++ b/content/browser/renderer_host/render_widget_host_view_android.cc
@@ -1234,11 +1234,28 @@ void RenderWidgetHostViewAndroid::OnFrameMetadataUpdated(
if (!content_view_core_)
return;
+ const cc::ViewportSelectionBound& selection_start =
+ frame_metadata.selection_start;
+ const cc::ViewportSelectionBound& selection_end =
+ frame_metadata.selection_start;
if (selection_controller_) {
- selection_controller_->OnSelectionBoundsChanged(
- frame_metadata.selection_start, frame_metadata.selection_end);
+ selection_controller_->OnSelectionBoundsChanged(selection_start,
+ selection_end);
}
+ const bool has_insertion_marker =
+ selection_start.type == cc::SELECTION_BOUND_CENTER &&
+ selection_end.type == cc::SELECTION_BOUND_CENTER &&
+ selection_start.edge_top.x() == selection_start.edge_bottom.x() &&
+ selection_end.edge_top.x() == selection_end.edge_bottom.x() &&
+ selection_start.edge_top.x() == selection_end.edge_bottom.x();
bcwhite 2014/11/06 18:57:19 Is there any chance these floats have tiny differe
yukawa 2014/11/07 00:52:47 Good point. Basically those conditions are always
bcwhite 2014/11/07 01:15:07 Yes. If it's not broken, don't fix it. You could
+ const float insertion_marker_x =
+ has_insertion_marker ? selection_start.edge_top.x() : 0.0f;
+ const float insertion_marker_top =
+ has_insertion_marker ? selection_start.edge_top.y() : 0.0f;
+ const float insertion_marker_bottom =
+ has_insertion_marker ? selection_start.edge_bottom.y() : 0.0f;
+
// All offsets and sizes are in CSS pixels.
content_view_core_->UpdateFrameInfo(
frame_metadata.root_scroll_offset,
@@ -1248,7 +1265,11 @@ void RenderWidgetHostViewAndroid::OnFrameMetadataUpdated(
frame_metadata.root_layer_size,
frame_metadata.scrollable_viewport_size,
frame_metadata.location_bar_offset,
- frame_metadata.location_bar_content_translation);
+ frame_metadata.location_bar_content_translation,
+ has_insertion_marker,
+ insertion_marker_x,
+ insertion_marker_top,
+ insertion_marker_bottom);
#if defined(VIDEO_HOLE)
if (host_ && host_->IsRenderView()) {
RenderViewHostImpl* rvhi = static_cast<RenderViewHostImpl*>(

Powered by Google App Engine
This is Rietveld 408576698