| 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 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 422 default: | 422 default: |
| 423 break; | 423 break; |
| 424 } | 424 } |
| 425 | 425 |
| 426 return consumed; | 426 return consumed; |
| 427 } | 427 } |
| 428 | 428 |
| 429 bool InputRouterImpl::OfferToRenderer(const WebInputEvent& input_event, | 429 bool InputRouterImpl::OfferToRenderer(const WebInputEvent& input_event, |
| 430 const ui::LatencyInfo& latency_info, | 430 const ui::LatencyInfo& latency_info, |
| 431 InputEventDispatchType dispatch_type) { | 431 InputEventDispatchType dispatch_type) { |
| 432 DCHECK(input_event.type != blink::WebInputEvent::GestureFlingStart || |
| 433 static_cast<const blink::WebGestureEvent&>(input_event) |
| 434 .data.flingStart.velocityX != 0.0 || |
| 435 static_cast<const blink::WebGestureEvent&>(input_event) |
| 436 .data.flingStart.velocityY != 0.0); |
| 437 |
| 432 // This conversion is temporary. WebInputEvent should be generated | 438 // This conversion is temporary. WebInputEvent should be generated |
| 433 // directly from ui::Event with the viewport coordinates. See | 439 // directly from ui::Event with the viewport coordinates. See |
| 434 // crbug.com/563730. | 440 // crbug.com/563730. |
| 435 std::unique_ptr<blink::WebInputEvent> event_in_viewport = | 441 std::unique_ptr<blink::WebInputEvent> event_in_viewport = |
| 436 ui::ScaleWebInputEvent(input_event, device_scale_factor_); | 442 ui::ScaleWebInputEvent(input_event, device_scale_factor_); |
| 437 const WebInputEvent* event_to_send = | 443 const WebInputEvent* event_to_send = |
| 438 event_in_viewport ? event_in_viewport.get() : &input_event; | 444 event_in_viewport ? event_in_viewport.get() : &input_event; |
| 439 | 445 |
| 440 if (Send(new InputMsg_HandleInputEvent(routing_id(), event_to_send, | 446 if (Send(new InputMsg_HandleInputEvent(routing_id(), event_to_send, |
| 441 latency_info, dispatch_type))) { | 447 latency_info, dispatch_type))) { |
| (...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 648 | 654 |
| 649 flush_requested_ = false; | 655 flush_requested_ = false; |
| 650 client_->DidFlush(); | 656 client_->DidFlush(); |
| 651 } | 657 } |
| 652 | 658 |
| 653 void InputRouterImpl::SetFrameTreeNodeId(int frameTreeNodeId) { | 659 void InputRouterImpl::SetFrameTreeNodeId(int frameTreeNodeId) { |
| 654 frame_tree_node_id_ = frameTreeNodeId; | 660 frame_tree_node_id_ = frameTreeNodeId; |
| 655 } | 661 } |
| 656 | 662 |
| 657 } // namespace content | 663 } // namespace content |
| OLD | NEW |