Chromium Code Reviews| Index: content/renderer/render_view_impl.cc |
| diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc |
| index bb881cbbd0bdf2581d61e758bd9e8c9974b8a082..bdf5e2ab76d66a3782e9cc88a0ffd43d98adbe70 100644 |
| --- a/content/renderer/render_view_impl.cc |
| +++ b/content/renderer/render_view_impl.cc |
| @@ -1357,6 +1357,8 @@ bool RenderViewImpl::OnMessageReceived(const IPC::Message& message) { |
| OnReleaseDisambiguationPopupBitmap) |
| IPC_MESSAGE_HANDLER(ViewMsg_ForceRedraw, OnForceRedraw) |
| IPC_MESSAGE_HANDLER(ViewMsg_SelectWordAroundCaret, OnSelectWordAroundCaret) |
| + IPC_MESSAGE_HANDLER(ViewMsg_ExpandSelectionByCharacterOffset, |
| + OnExpandSelectionByCharacterOffset) |
| #if defined(OS_ANDROID) |
| IPC_MESSAGE_HANDLER(InputMsg_ActivateNearestFindResult, |
| OnActivateNearestFindResult) |
| @@ -1393,6 +1395,25 @@ void RenderViewImpl::OnSelectWordAroundCaret() { |
| handling_input_event_ = false; |
| } |
| +void RenderViewImpl::OnExpandSelectionByCharacterOffset(int start_adjust, |
| + int end_adjust) { |
| + if (!webview()) |
| + return; |
| + |
| + handling_input_event_ = true; |
| + size_t start, length; |
| + if (webview()->caretOrSelectionRange(&start, &length)) { |
| + start -= start_adjust; |
| + length += end_adjust + start_adjust; |
| + WebLocalFrame* web_local_frame = |
| + webview()->focusedFrame()->toWebLocalFrame(); |
|
pedro (no code reviews)
2015/07/01 22:18:57
Please confirm with someone familiar with the WebV
aurimas (slooooooooow)
2015/07/01 23:05:44
Do you have suggestions about who to ask to review
pedro (no code reviews)
2015/07/02 00:09:57
I would say yoichio@ since he is the one who sugge
|
| + web_local_frame->selectRange(WebRange::fromDocumentRange(web_local_frame, |
| + start, |
| + length)); |
| + } |
| + handling_input_event_ = false; |
| +} |
| + |
| void RenderViewImpl::OnCopyImageAt(int x, int y) { |
| webview()->copyImageAt(WebPoint(x, y)); |
| } |