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 "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
(...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
439 } | 439 } |
440 | 440 |
441 if (OfferToOverscrollController(input_event, latency_info)) | 441 if (OfferToOverscrollController(input_event, latency_info)) |
442 return; | 442 return; |
443 | 443 |
444 if (OfferToClient(input_event, latency_info)) | 444 if (OfferToClient(input_event, latency_info)) |
445 return; | 445 return; |
446 | 446 |
447 OfferToRenderer(input_event, latency_info, is_keyboard_shortcut); | 447 OfferToRenderer(input_event, latency_info, is_keyboard_shortcut); |
448 | 448 |
| 449 // Touch events should always indicate in the event whether they are |
| 450 // cancelable (respect ACK disposition) or not. |
| 451 bool ignoresAck = |
| 452 WebInputEventTraits::IgnoresAckDisposition(input_event.type); |
| 453 if (WebInputEvent::isTouchEventType(input_event.type)) { |
| 454 DCHECK(!ignoresAck == |
| 455 static_cast<const blink::WebTouchEvent&>(input_event).cancelable); |
| 456 } |
| 457 |
449 // If we don't care about the ack disposition, send the ack immediately. | 458 // If we don't care about the ack disposition, send the ack immediately. |
450 if (WebInputEventTraits::IgnoresAckDisposition(input_event.type)) { | 459 if (ignoresAck) { |
451 ProcessInputEventAck(input_event.type, | 460 ProcessInputEventAck(input_event.type, |
452 INPUT_EVENT_ACK_STATE_IGNORED, | 461 INPUT_EVENT_ACK_STATE_IGNORED, |
453 latency_info, | 462 latency_info, |
454 IGNORING_DISPOSITION); | 463 IGNORING_DISPOSITION); |
455 } | 464 } |
456 } | 465 } |
457 | 466 |
458 bool InputRouterImpl::OfferToOverscrollController( | 467 bool InputRouterImpl::OfferToOverscrollController( |
459 const WebInputEvent& input_event, | 468 const WebInputEvent& input_event, |
460 const ui::LatencyInfo& latency_info) { | 469 const ui::LatencyInfo& latency_info) { |
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
849 select_range_pending_ || | 858 select_range_pending_ || |
850 move_caret_pending_; | 859 move_caret_pending_; |
851 } | 860 } |
852 | 861 |
853 bool InputRouterImpl::IsInOverscrollGesture() const { | 862 bool InputRouterImpl::IsInOverscrollGesture() const { |
854 OverscrollController* controller = client_->GetOverscrollController(); | 863 OverscrollController* controller = client_->GetOverscrollController(); |
855 return controller && controller->overscroll_mode() != OVERSCROLL_NONE; | 864 return controller && controller->overscroll_mode() != OVERSCROLL_NONE; |
856 } | 865 } |
857 | 866 |
858 } // namespace content | 867 } // namespace content |
OLD | NEW |