| 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 | 8 |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 365 OfferToHandlers(input_event, latency_info); | 365 OfferToHandlers(input_event, latency_info); |
| 366 } | 366 } |
| 367 | 367 |
| 368 void InputRouterImpl::OfferToHandlers(const WebInputEvent& input_event, | 368 void InputRouterImpl::OfferToHandlers(const WebInputEvent& input_event, |
| 369 const ui::LatencyInfo& latency_info) { | 369 const ui::LatencyInfo& latency_info) { |
| 370 output_stream_validator_.Validate(input_event); | 370 output_stream_validator_.Validate(input_event); |
| 371 | 371 |
| 372 if (OfferToClient(input_event, latency_info)) | 372 if (OfferToClient(input_event, latency_info)) |
| 373 return; | 373 return; |
| 374 | 374 |
| 375 // Touch events should always indicate in the event whether they are | |
| 376 // cancelable (respect ACK disposition) or not, except touchmove and | |
| 377 // touchscollstarted. | |
| 378 bool should_block = WebInputEventTraits::ShouldBlockEventStream(input_event); | 375 bool should_block = WebInputEventTraits::ShouldBlockEventStream(input_event); |
| 379 if (WebInputEvent::isTouchEventType(input_event.type) && | |
| 380 input_event.type != WebInputEvent::TouchMove && | |
| 381 input_event.type != WebInputEvent::TouchScrollStarted) { | |
| 382 const WebTouchEvent& touch = static_cast<const WebTouchEvent&>(input_event); | |
| 383 DCHECK_EQ(should_block, touch.cancelable); | |
| 384 } | |
| 385 | |
| 386 OfferToRenderer(input_event, latency_info, | 376 OfferToRenderer(input_event, latency_info, |
| 387 should_block | 377 should_block |
| 388 ? InputEventDispatchType::DISPATCH_TYPE_BLOCKING | 378 ? InputEventDispatchType::DISPATCH_TYPE_BLOCKING |
| 389 : InputEventDispatchType::DISPATCH_TYPE_NON_BLOCKING); | 379 : InputEventDispatchType::DISPATCH_TYPE_NON_BLOCKING); |
| 390 | 380 |
| 391 // Generate a synthetic ack if the event was sent so it doesn't block. | 381 // Generate a synthetic ack if the event was sent so it doesn't block. |
| 392 if (!should_block) { | 382 if (!should_block) { |
| 393 ProcessInputEventAck( | 383 ProcessInputEventAck( |
| 394 input_event.type, INPUT_EVENT_ACK_STATE_IGNORED, latency_info, | 384 input_event.type, INPUT_EVENT_ACK_STATE_IGNORED, latency_info, |
| 395 WebInputEventTraits::GetUniqueTouchEventId(input_event), | 385 WebInputEventTraits::GetUniqueTouchEventId(input_event), |
| (...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 647 | 637 |
| 648 flush_requested_ = false; | 638 flush_requested_ = false; |
| 649 client_->DidFlush(); | 639 client_->DidFlush(); |
| 650 } | 640 } |
| 651 | 641 |
| 652 void InputRouterImpl::SetFrameTreeNodeId(int frameTreeNodeId) { | 642 void InputRouterImpl::SetFrameTreeNodeId(int frameTreeNodeId) { |
| 653 frame_tree_node_id_ = frameTreeNodeId; | 643 frame_tree_node_id_ = frameTreeNodeId; |
| 654 } | 644 } |
| 655 | 645 |
| 656 } // namespace content | 646 } // namespace content |
| OLD | NEW |