| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/render_widget_host_input_event_router.h" | 5 #include "content/browser/renderer_host/render_widget_host_input_event_router.h" |
| 6 | 6 |
| 7 #include "base/metrics/histogram_macros.h" | 7 #include "base/metrics/histogram_macros.h" |
| 8 #include "cc/quads/surface_draw_quad.h" | 8 #include "cc/quads/surface_draw_quad.h" |
| 9 #include "cc/surfaces/surface_id_allocator.h" | 9 #include "cc/surfaces/surface_id_allocator.h" |
| 10 #include "cc/surfaces/surface_manager.h" | 10 #include "cc/surfaces/surface_manager.h" |
| (...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 419 void RenderWidgetHostInputEventRouter::OnHittestData( | 419 void RenderWidgetHostInputEventRouter::OnHittestData( |
| 420 const FrameHostMsg_HittestData_Params& params) { | 420 const FrameHostMsg_HittestData_Params& params) { |
| 421 if (owner_map_.find(params.surface_id.client_id()) == owner_map_.end()) { | 421 if (owner_map_.find(params.surface_id.client_id()) == owner_map_.end()) { |
| 422 return; | 422 return; |
| 423 } | 423 } |
| 424 HittestData data; | 424 HittestData data; |
| 425 data.ignored_for_hittest = params.ignored_for_hittest; | 425 data.ignored_for_hittest = params.ignored_for_hittest; |
| 426 hittest_data_[params.surface_id] = data; | 426 hittest_data_[params.surface_id] = data; |
| 427 } | 427 } |
| 428 | 428 |
| 429 RenderWidgetHostImpl* |
| 430 RenderWidgetHostInputEventRouter::GetRenderWidgetHostAtPoint( |
| 431 RenderWidgetHostViewBase* root_view, |
| 432 const gfx::Point& point, |
| 433 gfx::Point* transformed_point) { |
| 434 return RenderWidgetHostImpl::From( |
| 435 FindEventTarget(root_view, point, transformed_point) |
| 436 ->GetRenderWidgetHost()); |
| 437 } |
| 438 |
| 429 void RenderWidgetHostInputEventRouter::RouteTouchscreenGestureEvent( | 439 void RenderWidgetHostInputEventRouter::RouteTouchscreenGestureEvent( |
| 430 RenderWidgetHostViewBase* root_view, | 440 RenderWidgetHostViewBase* root_view, |
| 431 blink::WebGestureEvent* event, | 441 blink::WebGestureEvent* event, |
| 432 const ui::LatencyInfo& latency) { | 442 const ui::LatencyInfo& latency) { |
| 433 DCHECK_EQ(blink::WebGestureDeviceTouchscreen, event->sourceDevice); | 443 DCHECK_EQ(blink::WebGestureDeviceTouchscreen, event->sourceDevice); |
| 434 | 444 |
| 435 if (event->type == blink::WebInputEvent::GesturePinchBegin) { | 445 if (event->type == blink::WebInputEvent::GesturePinchBegin) { |
| 436 in_touchscreen_gesture_pinch_ = true; | 446 in_touchscreen_gesture_pinch_ = true; |
| 437 // If the root view wasn't already receiving the gesture stream, then we | 447 // If the root view wasn't already receiving the gesture stream, then we |
| 438 // need to wrap the diverted pinch events in a GestureScrollBegin/End. | 448 // need to wrap the diverted pinch events in a GestureScrollBegin/End. |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 543 if (!touchpad_gesture_target_.target) | 553 if (!touchpad_gesture_target_.target) |
| 544 return; | 554 return; |
| 545 | 555 |
| 546 // TODO(mohsen): Add tests to check event location. | 556 // TODO(mohsen): Add tests to check event location. |
| 547 event->x += touchpad_gesture_target_.delta.x(); | 557 event->x += touchpad_gesture_target_.delta.x(); |
| 548 event->y += touchpad_gesture_target_.delta.y(); | 558 event->y += touchpad_gesture_target_.delta.y(); |
| 549 touchpad_gesture_target_.target->ProcessGestureEvent(*event, latency); | 559 touchpad_gesture_target_.target->ProcessGestureEvent(*event, latency); |
| 550 } | 560 } |
| 551 | 561 |
| 552 } // namespace content | 562 } // namespace content |
| OLD | NEW |