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

Unified Diff: content/renderer/render_view_impl.cc

Issue 2703643004: [TTS] Add an ACK message to SelectWordAroundCaret. (Closed)
Patch Set: Changed to send the message on all platforms, not just Android. Created 3 years, 10 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
« no previous file with comments | « content/public/android/java/src/org/chromium/content/browser/SelectionPopupController.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_view_impl.cc
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc
index 65b2fdc53609d0d663e60780b1b5f3c3eb536451..70302b9dd02890820f8ad81e4e93464e83e92fb6 100644
--- a/content/renderer/render_view_impl.cc
+++ b/content/renderer/render_view_impl.cc
@@ -1296,7 +1296,18 @@ void RenderViewImpl::OnSelectWordAroundCaret() {
return;
input_handler_->set_handling_input_event(true);
- webview()->focusedFrame()->selectWordAroundCaret();
+ 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_SelectWordAroundCaretAck(GetRoutingID(), did_select,
+ start_adjust, end_adjust));
input_handler_->set_handling_input_event(false);
}
« no previous file with comments | « content/public/android/java/src/org/chromium/content/browser/SelectionPopupController.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698