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 fc720a7e09f1fbc141ce44bb2c8e9d606b533e34..ab2621a800002c24d410e57168d3a298acf52954 100644 |
| --- a/content/browser/frame_host/render_widget_host_view_guest.cc |
| +++ b/content/browser/frame_host/render_widget_host_view_guest.cc |
| @@ -551,9 +551,37 @@ void RenderWidgetHostViewGuest::GestureEventAck( |
| ack_result == INPUT_EVENT_ACK_STATE_NO_CONSUMER_EXISTS; |
| // GestureScrollBegin/End are always consumed by the guest, so we only |
| // forward GestureScrollUpdate. |
| + // Consumed GestureScrollUpdates and GestureScrollBegins must still be |
| + // forwarded to the owner RWHV so it may update its state. |
| if (event.GetType() == blink::WebInputEvent::kGestureScrollUpdate && |
| not_consumed) |
| guest_->ResendEventToEmbedder(event); |
| + else if (event.GetType() == blink::WebInputEvent::kGestureScrollUpdate || |
|
Charlie Reis
2017/05/05 23:45:44
Style nit: I think it would improve readability to
Kevin McNee
2017/05/17 22:39:33
Done.
|
| + event.GetType() == blink::WebInputEvent::kGestureScrollBegin) |
| + GetOwnerRenderWidgetHostView()->GestureEventAck(event, ack_result); |
| +} |
| + |
| +InputEventAckState RenderWidgetHostViewGuest::FilterInputEvent( |
| + const blink::WebInputEvent& input_event) { |
| + InputEventAckState ack_state = |
| + RenderWidgetHostViewChildFrame::FilterInputEvent(input_event); |
| + if (ack_state != INPUT_EVENT_ACK_STATE_NOT_CONSUMED) |
| + return ack_state; |
| + |
| + // The owner RWHV may want to consume the guest's GestureScrollUpdates. |
| + // Also, we don't resend GestureFlingStarts, GestureScrollBegins, or |
| + // GestureScrollEnds, so we let the owner RWHV know about them here. |
| + if (input_event.GetType() == blink::WebInputEvent::kGestureScrollUpdate || |
| + input_event.GetType() == blink::WebInputEvent::kGestureFlingStart || |
| + input_event.GetType() == blink::WebInputEvent::kGestureScrollBegin || |
| + input_event.GetType() == blink::WebInputEvent::kGestureScrollEnd) { |
| + const blink::WebGestureEvent& gesture_event = |
| + static_cast<const blink::WebGestureEvent&>(input_event); |
| + return GetOwnerRenderWidgetHostView()->FilterChildGestureEvent( |
| + gesture_event); |
| + } |
| + |
| + return INPUT_EVENT_ACK_STATE_NOT_CONSUMED; |
| } |
| bool RenderWidgetHostViewGuest::IsRenderWidgetHostViewGuest() { |