OLD | NEW |
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 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
272 IPC_MESSAGE_HANDLER(InputHostMsg_DidOverscroll, OnDidOverscroll) | 272 IPC_MESSAGE_HANDLER(InputHostMsg_DidOverscroll, OnDidOverscroll) |
273 IPC_MESSAGE_HANDLER(InputHostMsg_MoveCaret_ACK, OnMsgMoveCaretAck) | 273 IPC_MESSAGE_HANDLER(InputHostMsg_MoveCaret_ACK, OnMsgMoveCaretAck) |
274 IPC_MESSAGE_HANDLER(InputHostMsg_SelectRange_ACK, OnSelectMessageAck) | 274 IPC_MESSAGE_HANDLER(InputHostMsg_SelectRange_ACK, OnSelectMessageAck) |
275 IPC_MESSAGE_HANDLER(InputHostMsg_MoveRangeSelectionExtent_ACK, | 275 IPC_MESSAGE_HANDLER(InputHostMsg_MoveRangeSelectionExtent_ACK, |
276 OnSelectMessageAck) | 276 OnSelectMessageAck) |
277 IPC_MESSAGE_HANDLER(ViewHostMsg_HasTouchEventHandlers, | 277 IPC_MESSAGE_HANDLER(ViewHostMsg_HasTouchEventHandlers, |
278 OnHasTouchEventHandlers) | 278 OnHasTouchEventHandlers) |
279 IPC_MESSAGE_HANDLER(InputHostMsg_SetTouchAction, | 279 IPC_MESSAGE_HANDLER(InputHostMsg_SetTouchAction, |
280 OnSetTouchAction) | 280 OnSetTouchAction) |
281 IPC_MESSAGE_HANDLER(InputHostMsg_DidStopFlinging, OnDidStopFlinging) | 281 IPC_MESSAGE_HANDLER(InputHostMsg_DidStopFlinging, OnDidStopFlinging) |
| 282 IPC_MESSAGE_HANDLER(InputHostMsg_DidSelectWordAt, OnDidSelectWordAt) |
282 IPC_MESSAGE_UNHANDLED(handled = false) | 283 IPC_MESSAGE_UNHANDLED(handled = false) |
283 IPC_END_MESSAGE_MAP() | 284 IPC_END_MESSAGE_MAP() |
284 | 285 |
285 return handled; | 286 return handled; |
286 } | 287 } |
287 | 288 |
288 void InputRouterImpl::OnTouchEventAck(const TouchEventWithLatencyInfo& event, | 289 void InputRouterImpl::OnTouchEventAck(const TouchEventWithLatencyInfo& event, |
289 InputEventAckState ack_result) { | 290 InputEventAckState ack_result) { |
290 // 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 |
291 // 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 Loading... |
506 DCHECK_GT(active_renderer_fling_count_, 0); | 507 DCHECK_GT(active_renderer_fling_count_, 0); |
507 // 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 |
508 // renderer, not from any other consumers. Consequently, the GestureEventQueue | 509 // renderer, not from any other consumers. Consequently, the GestureEventQueue |
509 // cannot use this bookkeeping for logic like tap suppression. | 510 // cannot use this bookkeeping for logic like tap suppression. |
510 --active_renderer_fling_count_; | 511 --active_renderer_fling_count_; |
511 SignalFlushedIfNecessary(); | 512 SignalFlushedIfNecessary(); |
512 | 513 |
513 client_->DidStopFlinging(); | 514 client_->DidStopFlinging(); |
514 } | 515 } |
515 | 516 |
| 517 void InputRouterImpl::OnDidSelectWordAt() { |
| 518 client_->DidSelectWordAt(); |
| 519 } |
| 520 |
516 void InputRouterImpl::ProcessInputEventAck(WebInputEvent::Type event_type, | 521 void InputRouterImpl::ProcessInputEventAck(WebInputEvent::Type event_type, |
517 InputEventAckState ack_result, | 522 InputEventAckState ack_result, |
518 const ui::LatencyInfo& latency_info, | 523 const ui::LatencyInfo& latency_info, |
519 uint32_t unique_touch_event_id, | 524 uint32_t unique_touch_event_id, |
520 AckSource ack_source) { | 525 AckSource ack_source) { |
521 TRACE_EVENT2("input", "InputRouterImpl::ProcessInputEventAck", | 526 TRACE_EVENT2("input", "InputRouterImpl::ProcessInputEventAck", |
522 "type", WebInputEventTraits::GetName(event_type), | 527 "type", WebInputEventTraits::GetName(event_type), |
523 "ack", GetEventAckName(ack_result)); | 528 "ack", GetEventAckName(ack_result)); |
524 | 529 |
525 // 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 Loading... |
651 return; | 656 return; |
652 | 657 |
653 if (HasPendingEvents()) | 658 if (HasPendingEvents()) |
654 return; | 659 return; |
655 | 660 |
656 flush_requested_ = false; | 661 flush_requested_ = false; |
657 client_->DidFlush(); | 662 client_->DidFlush(); |
658 } | 663 } |
659 | 664 |
660 } // namespace content | 665 } // namespace content |
OLD | NEW |