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

Unified Diff: content/browser/renderer_host/input/input_router_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
Index: content/browser/renderer_host/input/input_router_impl.cc
diff --git a/content/browser/renderer_host/input/input_router_impl.cc b/content/browser/renderer_host/input/input_router_impl.cc
index 441f9384bb8745e05efd53d9e1e645aa94255124..d940e239f6834f8da63ac2ef5650540fff412a71 100644
--- a/content/browser/renderer_host/input/input_router_impl.cc
+++ b/content/browser/renderer_host/input/input_router_impl.cc
@@ -69,6 +69,7 @@ InputRouterImpl::InputRouterImpl(IPC::Sender* sender,
ack_handler_(ack_handler),
routing_id_(routing_id),
select_range_pending_(false),
+ move_selection_extent_pending_(false),
move_caret_pending_(false),
mouse_move_pending_(false),
mouse_wheel_pending_(false),
@@ -96,6 +97,8 @@ bool InputRouterImpl::SendInput(scoped_ptr<IPC::Message> message) {
// Check for types that require an ACK.
case InputMsg_SelectRange::ID:
return SendSelectRange(message.Pass());
+ case InputMsg_MoveSelectionExtent::ID:
+ return SendMoveSelectionExtent(message.Pass());
case InputMsg_MoveCaret::ID:
return SendMoveCaret(message.Pass());
case InputMsg_HandleInputEvent::ID:
@@ -269,6 +272,8 @@ bool InputRouterImpl::OnMessageReceived(const IPC::Message& message) {
IPC_MESSAGE_HANDLER(InputHostMsg_DidOverscroll, OnDidOverscroll)
IPC_MESSAGE_HANDLER(ViewHostMsg_MoveCaret_ACK, OnMsgMoveCaretAck)
IPC_MESSAGE_HANDLER(ViewHostMsg_SelectRange_ACK, OnSelectRangeAck)
+ IPC_MESSAGE_HANDLER(ViewHostMsg_MoveSelectionExtent_ACK,
+ OnMoveSelectionExtentAck)
IPC_MESSAGE_HANDLER(ViewHostMsg_HasTouchEventHandlers,
OnHasTouchEventHandlers)
IPC_MESSAGE_HANDLER(InputHostMsg_SetTouchAction,
@@ -309,6 +314,18 @@ bool InputRouterImpl::SendSelectRange(scoped_ptr<IPC::Message> message) {
return Send(message.release());
}
+bool InputRouterImpl::SendMoveSelectionExtent(
+ scoped_ptr<IPC::Message> message) {
+ DCHECK(message->type() == InputMsg_SelectRange::ID);
+ if (move_selection_extent_pending_) {
jdduke (slow) 2014/10/15 15:46:07 There's probably some common logic between SelectR
christiank 2014/10/17 14:33:05 Yes, I noticed this. I didn't address it in this C
+ next_selection_extent_move_ = message.Pass();
+ return true;
+ }
+
+ move_selection_extent_pending_ = true;
+ return Send(message.release());
+}
+
bool InputRouterImpl::SendMoveCaret(scoped_ptr<IPC::Message> message) {
DCHECK(message->type() == InputMsg_MoveCaret::ID);
if (move_caret_pending_) {
@@ -493,6 +510,12 @@ void InputRouterImpl::OnSelectRangeAck() {
SendSelectRange(next_selection_range_.Pass());
}
+void InputRouterImpl::OnMoveSelectionExtentAck() {
+ move_selection_extent_pending_ = false;
+ if (next_selection_extent_move_)
+ SendMoveSelectionExtent(next_selection_extent_move_.Pass());
+}
+
void InputRouterImpl::OnHasTouchEventHandlers(bool has_handlers) {
TRACE_EVENT1("input", "InputRouterImpl::OnHasTouchEventHandlers",
"has_handlers", has_handlers);
@@ -680,6 +703,7 @@ bool InputRouterImpl::HasPendingEvents() const {
mouse_move_pending_ ||
mouse_wheel_pending_ ||
select_range_pending_ ||
+ move_selection_extent_pending_ ||
move_caret_pending_;
}

Powered by Google App Engine
This is Rietveld 408576698