| 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 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 367 | 367 |
| 368 if (OfferToClient(input_event, latency_info)) | 368 if (OfferToClient(input_event, latency_info)) |
| 369 return; | 369 return; |
| 370 | 370 |
| 371 bool should_block = WebInputEventTraits::ShouldBlockEventStream(input_event); | 371 bool should_block = WebInputEventTraits::ShouldBlockEventStream(input_event); |
| 372 OfferToRenderer(input_event, latency_info, | 372 OfferToRenderer(input_event, latency_info, |
| 373 should_block | 373 should_block |
| 374 ? InputEventDispatchType::DISPATCH_TYPE_BLOCKING | 374 ? InputEventDispatchType::DISPATCH_TYPE_BLOCKING |
| 375 : InputEventDispatchType::DISPATCH_TYPE_NON_BLOCKING); | 375 : InputEventDispatchType::DISPATCH_TYPE_NON_BLOCKING); |
| 376 | 376 |
| 377 if (WebInputEvent::isTouchEventType(input_event.type) && | |
| 378 input_event.type != WebInputEvent::TouchMove) { | |
| 379 const WebTouchEvent& touch = static_cast<const WebTouchEvent&>(input_event); | |
| 380 DCHECK_EQ(should_block, touch.cancelable); | |
| 381 } | |
| 382 | |
| 383 // Generate a synthetic ack if the event was sent so it doesn't block. | 377 // Generate a synthetic ack if the event was sent so it doesn't block. |
| 384 if (!should_block) { | 378 if (!should_block) { |
| 385 ProcessInputEventAck( | 379 ProcessInputEventAck( |
| 386 input_event.type, INPUT_EVENT_ACK_STATE_IGNORED, latency_info, | 380 input_event.type, INPUT_EVENT_ACK_STATE_IGNORED, latency_info, |
| 387 WebInputEventTraits::GetUniqueTouchEventId(input_event), | 381 WebInputEventTraits::GetUniqueTouchEventId(input_event), |
| 388 IGNORING_DISPOSITION); | 382 IGNORING_DISPOSITION); |
| 389 } | 383 } |
| 390 } | 384 } |
| 391 | 385 |
| 392 bool InputRouterImpl::OfferToClient(const WebInputEvent& input_event, | 386 bool InputRouterImpl::OfferToClient(const WebInputEvent& input_event, |
| (...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 639 | 633 |
| 640 flush_requested_ = false; | 634 flush_requested_ = false; |
| 641 client_->DidFlush(); | 635 client_->DidFlush(); |
| 642 } | 636 } |
| 643 | 637 |
| 644 void InputRouterImpl::SetFrameTreeNodeId(int frameTreeNodeId) { | 638 void InputRouterImpl::SetFrameTreeNodeId(int frameTreeNodeId) { |
| 645 frame_tree_node_id_ = frameTreeNodeId; | 639 frame_tree_node_id_ = frameTreeNodeId; |
| 646 } | 640 } |
| 647 | 641 |
| 648 } // namespace content | 642 } // namespace content |
| OLD | NEW |