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

Unified Diff: content/browser/web_contents/web_contents_impl.cc

Issue 829913004: WIP: Plumbing through text selection granularity control support (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@unified_text_selection_diff
Patch Set: Missing file. Created 5 years, 11 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/browser/web_contents/web_contents_impl.h ('k') | content/common/DEPS » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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));
}
« no previous file with comments | « content/browser/web_contents/web_contents_impl.h ('k') | content/common/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698