| 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 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 412 } | 412 } |
| 413 | 413 |
| 414 bool InputRouterImpl::OfferToRenderer(const WebInputEvent& input_event, | 414 bool InputRouterImpl::OfferToRenderer(const WebInputEvent& input_event, |
| 415 const ui::LatencyInfo& latency_info, | 415 const ui::LatencyInfo& latency_info, |
| 416 InputEventDispatchType dispatch_type) { | 416 InputEventDispatchType dispatch_type) { |
| 417 DCHECK(input_event.type != blink::WebInputEvent::GestureFlingStart || | 417 DCHECK(input_event.type != blink::WebInputEvent::GestureFlingStart || |
| 418 static_cast<const blink::WebGestureEvent&>(input_event) | 418 static_cast<const blink::WebGestureEvent&>(input_event) |
| 419 .data.flingStart.velocityX != 0.0 || | 419 .data.flingStart.velocityX != 0.0 || |
| 420 static_cast<const blink::WebGestureEvent&>(input_event) | 420 static_cast<const blink::WebGestureEvent&>(input_event) |
| 421 .data.flingStart.velocityY != 0.0); | 421 .data.flingStart.velocityY != 0.0); |
| 422 | 422 VLOG(0) << "InputRouterImpl::OfferToRenderer: " << input_event.type; |
| 423 // This conversion is temporary. WebInputEvent should be generated | 423 // This conversion is temporary. WebInputEvent should be generated |
| 424 // directly from ui::Event with the viewport coordinates. See | 424 // directly from ui::Event with the viewport coordinates. See |
| 425 // crbug.com/563730. | 425 // crbug.com/563730. |
| 426 std::unique_ptr<blink::WebInputEvent> event_in_viewport = | 426 std::unique_ptr<blink::WebInputEvent> event_in_viewport = |
| 427 ui::ScaleWebInputEvent(input_event, device_scale_factor_); | 427 ui::ScaleWebInputEvent(input_event, device_scale_factor_); |
| 428 const WebInputEvent* event_to_send = | 428 const WebInputEvent* event_to_send = |
| 429 event_in_viewport ? event_in_viewport.get() : &input_event; | 429 event_in_viewport ? event_in_viewport.get() : &input_event; |
| 430 | 430 |
| 431 if (Send(new InputMsg_HandleInputEvent(routing_id(), event_to_send, | 431 if (Send(new InputMsg_HandleInputEvent(routing_id(), event_to_send, |
| 432 latency_info, dispatch_type))) { | 432 latency_info, dispatch_type))) { |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 635 | 635 |
| 636 flush_requested_ = false; | 636 flush_requested_ = false; |
| 637 client_->DidFlush(); | 637 client_->DidFlush(); |
| 638 } | 638 } |
| 639 | 639 |
| 640 void InputRouterImpl::SetFrameTreeNodeId(int frameTreeNodeId) { | 640 void InputRouterImpl::SetFrameTreeNodeId(int frameTreeNodeId) { |
| 641 frame_tree_node_id_ = frameTreeNodeId; | 641 frame_tree_node_id_ = frameTreeNodeId; |
| 642 } | 642 } |
| 643 | 643 |
| 644 } // namespace content | 644 } // namespace content |
| OLD | NEW |