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

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: 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
« content/common/view_messages.h ('K') | « content/renderer/render_frame_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..86d9a3a75d3761d04d8383417b912e998e2fddbb 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -824,6 +824,7 @@ 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_MoveSelectionExtent, OnMoveSelectionExtent)
IPC_MESSAGE_HANDLER(InputMsg_Replace, OnReplace)
IPC_MESSAGE_HANDLER(InputMsg_ReplaceMisspelling, OnReplaceMisspelling)
IPC_MESSAGE_HANDLER(InputMsg_ExtendSelectionAndDelete,
@@ -1224,6 +1225,15 @@ void RenderFrameImpl::OnUnselect() {
frame_->executeCommand(WebString::fromUTF8("Unselect"), GetFocusedElement());
}
+void RenderFrameImpl::OnMoveSelectionExtent(const gfx::Point& point) {
+ // This IPC is dispatched by RenderWidgetHost, so use its routing id.
+ Send(new ViewHostMsg_MoveSelectionExtent_ACK(
+ GetRenderWidget()->routing_id()));
+
+ base::AutoReset<bool> handling_select_range(&handling_select_range_, true);
+ frame_->moveSelectionExtent(point);
+}
+
void RenderFrameImpl::OnReplace(const base::string16& text) {
if (!frame_->hasSelection())
frame_->selectWordAroundCaret();
« content/common/view_messages.h ('K') | « content/renderer/render_frame_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698