Index: content/renderer/render_view_impl.cc |
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc |
index 65f6b337a9cae51b4f59338f35febd64f5319b6f..9cbd166207cd0e114469eaaa7a39bea0bf3727a7 100644 |
--- a/content/renderer/render_view_impl.cc |
+++ b/content/renderer/render_view_impl.cc |
@@ -1294,7 +1294,22 @@ void RenderViewImpl::OnSelectWordAroundCaret() { |
return; |
input_handler_->set_handling_input_event(true); |
+#if defined(OS_ANDROID) |
+ int start_adjust = 0; |
+ int end_adjust = 0; |
+ blink::WebRange initial_range = webview()->focusedFrame()->selectionRange(); |
+ bool did_select = webview()->focusedFrame()->selectWordAroundCaret(); |
+ if (did_select) { |
+ blink::WebRange adjusted_range = |
+ webview()->focusedFrame()->selectionRange(); |
+ start_adjust = adjusted_range.startOffset() - initial_range.startOffset(); |
+ end_adjust = adjusted_range.endOffset() - initial_range.endOffset(); |
+ } |
+ Send(new ViewHostMsg_SelectWordAroundCaret_ACK(GetRoutingID(), did_select, |
+ start_adjust, end_adjust)); |
+#else |
webview()->focusedFrame()->selectWordAroundCaret(); |
+#endif |
input_handler_->set_handling_input_event(false); |
} |