Chromium Code Reviews| Index: content/browser/frame_host/render_widget_host_view_guest.cc |
| diff --git a/content/browser/frame_host/render_widget_host_view_guest.cc b/content/browser/frame_host/render_widget_host_view_guest.cc |
| index 2f7ff291f026d98146d677db08171c8e438639c0..1964987c6c41c1cdadd3ee598a60ffe3ceaf740a 100644 |
| --- a/content/browser/frame_host/render_widget_host_view_guest.cc |
| +++ b/content/browser/frame_host/render_widget_host_view_guest.cc |
| @@ -175,6 +175,25 @@ void RenderWidgetHostViewGuest::ProcessTouchEvent( |
| guest_->GetOwnerRenderWidgetHostView()->GetRenderWidgetHost()); |
| if (!embedder->GetView()->HasFocus()) |
| embedder->GetView()->Focus(); |
| + |
| + // Since we now route GestureEvents directly to the guest renderer, we need |
| + // a way to make sure that the BrowserPlugin in the embedder gets focused so |
| + // that keyboard input (which still travels via BrowserPlugin) is routed to |
| + // the plugin and thus onwards to the guest. |
| + // TODO(wjmaclean): When we remove BrowserPlugin, delete this code. |
| + // http://crbug.com/533069 |
| + if (!HasFocus()) { |
| + auto offset = GetViewBounds().origin(); |
| + blink::WebGestureEvent gesture_tap_down; |
| + gesture_tap_down.sourceDevice = blink::WebGestureDeviceTouchscreen; |
| + gesture_tap_down.type = blink::WebGestureEvent::GestureTapDown; |
| + gesture_tap_down.x = event.touches[0].position.x + offset.x(); |
| + gesture_tap_down.y = event.touches[0].position.y + offset.y(); |
| + gesture_tap_down.globalX = event.touches[0].screenPosition.x; |
| + gesture_tap_down.globalY = event.touches[0].screenPosition.y; |
| + GetOwnerRenderWidgetHostView()->ProcessGestureEvent(gesture_tap_down, |
| + ui::LatencyInfo()); |
|
Charlie Reis
2016/06/27 21:05:06
Is there any need to send an equivalent "up" event
|
| + } |
| } |
| host_->ForwardTouchEventWithLatencyInfo(event, latency); |