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

Side by Side Diff: content/browser/renderer_host/input/input_router_impl.cc

Issue 1528153004: Look Up on Force Touch (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/renderer_host/input/input_router_impl.h" 5 #include "content/browser/renderer_host/input/input_router_impl.h"
6 6
7 #include <math.h> 7 #include <math.h>
8 8
9 #include "base/auto_reset.h" 9 #include "base/auto_reset.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 IPC_MESSAGE_HANDLER(InputHostMsg_DidOverscroll, OnDidOverscroll) 271 IPC_MESSAGE_HANDLER(InputHostMsg_DidOverscroll, OnDidOverscroll)
272 IPC_MESSAGE_HANDLER(InputHostMsg_MoveCaret_ACK, OnMsgMoveCaretAck) 272 IPC_MESSAGE_HANDLER(InputHostMsg_MoveCaret_ACK, OnMsgMoveCaretAck)
273 IPC_MESSAGE_HANDLER(InputHostMsg_SelectRange_ACK, OnSelectMessageAck) 273 IPC_MESSAGE_HANDLER(InputHostMsg_SelectRange_ACK, OnSelectMessageAck)
274 IPC_MESSAGE_HANDLER(InputHostMsg_MoveRangeSelectionExtent_ACK, 274 IPC_MESSAGE_HANDLER(InputHostMsg_MoveRangeSelectionExtent_ACK,
275 OnSelectMessageAck) 275 OnSelectMessageAck)
276 IPC_MESSAGE_HANDLER(ViewHostMsg_HasTouchEventHandlers, 276 IPC_MESSAGE_HANDLER(ViewHostMsg_HasTouchEventHandlers,
277 OnHasTouchEventHandlers) 277 OnHasTouchEventHandlers)
278 IPC_MESSAGE_HANDLER(InputHostMsg_SetTouchAction, 278 IPC_MESSAGE_HANDLER(InputHostMsg_SetTouchAction,
279 OnSetTouchAction) 279 OnSetTouchAction)
280 IPC_MESSAGE_HANDLER(InputHostMsg_DidStopFlinging, OnDidStopFlinging) 280 IPC_MESSAGE_HANDLER(InputHostMsg_DidStopFlinging, OnDidStopFlinging)
281 IPC_MESSAGE_HANDLER(InputHostMsg_DidSelectWordAtCoordinates,
282 OnDidSelectWordAtCoordinates)
281 IPC_MESSAGE_UNHANDLED(handled = false) 283 IPC_MESSAGE_UNHANDLED(handled = false)
282 IPC_END_MESSAGE_MAP() 284 IPC_END_MESSAGE_MAP()
283 285
284 return handled; 286 return handled;
285 } 287 }
286 288
287 void InputRouterImpl::OnTouchEventAck(const TouchEventWithLatencyInfo& event, 289 void InputRouterImpl::OnTouchEventAck(const TouchEventWithLatencyInfo& event,
288 InputEventAckState ack_result) { 290 InputEventAckState ack_result) {
289 // Touchstart events sent to the renderer indicate a new touch sequence, but 291 // Touchstart events sent to the renderer indicate a new touch sequence, but
290 // in some cases we may filter out sending the touchstart - catch those here. 292 // in some cases we may filter out sending the touchstart - catch those here.
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
505 DCHECK_GT(active_renderer_fling_count_, 0); 507 DCHECK_GT(active_renderer_fling_count_, 0);
506 // Note that we're only guaranteed to get a fling end notification from the 508 // Note that we're only guaranteed to get a fling end notification from the
507 // renderer, not from any other consumers. Consequently, the GestureEventQueue 509 // renderer, not from any other consumers. Consequently, the GestureEventQueue
508 // cannot use this bookkeeping for logic like tap suppression. 510 // cannot use this bookkeeping for logic like tap suppression.
509 --active_renderer_fling_count_; 511 --active_renderer_fling_count_;
510 SignalFlushedIfNecessary(); 512 SignalFlushedIfNecessary();
511 513
512 client_->DidStopFlinging(); 514 client_->DidStopFlinging();
513 } 515 }
514 516
517 void InputRouterImpl::OnDidSelectWordAtCoordinates() {
518 client_->DidSelectWordAtCoordinates();
519 }
520
515 void InputRouterImpl::ProcessInputEventAck(WebInputEvent::Type event_type, 521 void InputRouterImpl::ProcessInputEventAck(WebInputEvent::Type event_type,
516 InputEventAckState ack_result, 522 InputEventAckState ack_result,
517 const ui::LatencyInfo& latency_info, 523 const ui::LatencyInfo& latency_info,
518 uint32 unique_touch_event_id, 524 uint32 unique_touch_event_id,
519 AckSource ack_source) { 525 AckSource ack_source) {
520 TRACE_EVENT2("input", "InputRouterImpl::ProcessInputEventAck", 526 TRACE_EVENT2("input", "InputRouterImpl::ProcessInputEventAck",
521 "type", WebInputEventTraits::GetName(event_type), 527 "type", WebInputEventTraits::GetName(event_type),
522 "ack", GetEventAckName(ack_result)); 528 "ack", GetEventAckName(ack_result));
523 529
524 // Note: The keyboard ack must be treated carefully, as it may result in 530 // Note: The keyboard ack must be treated carefully, as it may result in
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
650 return; 656 return;
651 657
652 if (HasPendingEvents()) 658 if (HasPendingEvents())
653 return; 659 return;
654 660
655 flush_requested_ = false; 661 flush_requested_ = false;
656 client_->DidFlush(); 662 client_->DidFlush();
657 } 663 }
658 664
659 } // namespace content 665 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698