Index: content/browser/web_contents/web_contents_impl.cc |
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc |
index 41a767e7da3fe91aac8fa5579ed60d5240b79bb7..4f9d7bd9d1c9dd4ec6835fa2b04361430ac60615 100644 |
--- a/content/browser/web_contents/web_contents_impl.cc |
+++ b/content/browser/web_contents/web_contents_impl.cc |
@@ -1958,6 +1958,23 @@ void WebContentsImpl::SetHistoryOffsetAndLength(int history_offset, |
GetRenderViewHost(), history_offset, history_length); |
} |
+blink::WebLocalFrame::TextGranularity WebContentsImpl::ToWebTextGranularity( |
+ ui::TextSelectionGranularity granularity) { |
+ switch (granularity) { |
+ case ui::CHARACTER_GRANULARITY: |
+ return blink::WebLocalFrame::CharacterGranularity; |
+ case ui::WORD_GRANULARITY: |
+ return blink::WebLocalFrame::WordGranularity; |
+ case ui::SENTENCE_GRANULARITY: |
+ return blink::WebLocalFrame::SentenceGranularity; |
+ case ui::LINE_GRANULARITY: |
+ return blink::WebLocalFrame::LineGranularity; |
+ case ui::PARAGRAPH_GRANULARITY: |
+ return blink::WebLocalFrame::ParagraphGranularity; |
+ } |
+} |
+ |
+ |
void WebContentsImpl::SetHistoryOffsetAndLengthForView( |
RenderViewHost* render_view_host, |
int history_offset, |
@@ -3200,13 +3217,18 @@ void WebContentsImpl::SetIsLoading(RenderViewHost* render_view_host, |
type, Source<NavigationController>(&controller_), det); |
} |
-void WebContentsImpl::MoveRangeSelectionExtent(const gfx::Point& extent) { |
+void WebContentsImpl::MoveRangeSelectionExtent( |
+ const gfx::Point& extent, |
+ ui::TextSelectionGranularity granularity) { |
RenderFrameHost* focused_frame = GetFocusedFrame(); |
if (!focused_frame) |
return; |
+ //LOG(ERROR) << "WebContentsImpl::MoveRangeSelectionExtent"; |
focused_frame->Send(new InputMsg_MoveRangeSelectionExtent( |
- focused_frame->GetRoutingID(), extent)); |
+ focused_frame->GetRoutingID(), |
+ extent, |
+ ToWebTextGranularity(granularity))); |
} |
void WebContentsImpl::SelectRange(const gfx::Point& base, |
@@ -3215,6 +3237,7 @@ void WebContentsImpl::SelectRange(const gfx::Point& base, |
if (!focused_frame) |
return; |
+ LOG(ERROR) << "WebContentsImpl::SelectRange"; |
focused_frame->Send( |
new InputMsg_SelectRange(focused_frame->GetRoutingID(), base, extent)); |
} |