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

Unified Diff: content/renderer/render_frame_impl.cc

Issue 657803002: Update touch selection to only modify one selection point at a time. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix DCHECK Created 6 years, 2 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
Index: content/renderer/render_frame_impl.cc
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
index 2b8bcf0f6e9019f91f36b77e5f9a36f3ce3f46a3..16d0123ff0e96a53a0d61f1a985ddd1a30a0876c 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -824,6 +824,8 @@ bool RenderFrameImpl::OnMessageReceived(const IPC::Message& msg) {
IPC_MESSAGE_HANDLER(InputMsg_SelectAll, OnSelectAll)
IPC_MESSAGE_HANDLER(InputMsg_SelectRange, OnSelectRange)
IPC_MESSAGE_HANDLER(InputMsg_Unselect, OnUnselect)
+ IPC_MESSAGE_HANDLER(InputMsg_MoveRangeSelectionExtent,
+ OnMoveRangeSelectionExtent)
IPC_MESSAGE_HANDLER(InputMsg_Replace, OnReplace)
IPC_MESSAGE_HANDLER(InputMsg_ReplaceMisspelling, OnReplaceMisspelling)
IPC_MESSAGE_HANDLER(InputMsg_ExtendSelectionAndDelete,
@@ -1210,13 +1212,13 @@ void RenderFrameImpl::OnSelectAll() {
frame_->executeCommand(WebString::fromUTF8("SelectAll"), GetFocusedElement());
}
-void RenderFrameImpl::OnSelectRange(const gfx::Point& start,
- const gfx::Point& end) {
+void RenderFrameImpl::OnSelectRange(const gfx::Point& base,
+ const gfx::Point& extent) {
// This IPC is dispatched by RenderWidgetHost, so use its routing id.
- Send(new ViewHostMsg_SelectRange_ACK(GetRenderWidget()->routing_id()));
+ Send(new InputHostMsg_SelectRange_ACK(GetRenderWidget()->routing_id()));
base::AutoReset<bool> handling_select_range(&handling_select_range_, true);
- frame_->selectRange(start, end);
+ frame_->selectRange(base, extent);
}
void RenderFrameImpl::OnUnselect() {
@@ -1224,6 +1226,15 @@ void RenderFrameImpl::OnUnselect() {
frame_->executeCommand(WebString::fromUTF8("Unselect"), GetFocusedElement());
}
+void RenderFrameImpl::OnMoveRangeSelectionExtent(const gfx::Point& point) {
+ // This IPC is dispatched by RenderWidgetHost, so use its routing id.
+ Send(new InputHostMsg_MoveRangeSelectionExtent_ACK(
+ GetRenderWidget()->routing_id()));
+
+ base::AutoReset<bool> handling_select_range(&handling_select_range_, true);
+ frame_->moveRangeSelectionExtent(point);
+}
+
void RenderFrameImpl::OnReplace(const base::string16& text) {
if (!frame_->hasSelection())
frame_->selectWordAroundCaret();

Powered by Google App Engine
This is Rietveld 408576698