Index: content/browser/renderer_host/render_widget_host_impl.cc |
diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc |
index 93c8092ed9b0f20fc1cce09b48d5e9314d6347b8..9284dbe72d4fb725c0c1f7537d11eaf6827bac1f 100644 |
--- a/content/browser/renderer_host/render_widget_host_impl.cc |
+++ b/content/browser/renderer_host/render_widget_host_impl.cc |
@@ -1166,6 +1166,19 @@ void RenderWidgetHostImpl::QueueSyntheticGesture( |
} |
} |
+void RenderWidgetHostImpl::QueueSyntheticPointerAction( |
+ const SyntheticPointerActionParams& gesture_params, |
+ const base::Callback<void(SyntheticGesture::Result)>& on_complete) { |
+ if (!synthetic_gesture_controller_ && view_) { |
+ synthetic_gesture_controller_.reset( |
+ new SyntheticGestureController(view_->CreateSyntheticGestureTarget())); |
+ } |
+ if (synthetic_gesture_controller_) { |
+ synthetic_gesture_controller_->QueueSyntheticPointerAction(gesture_params, |
+ on_complete); |
+ } |
+} |
+ |
void RenderWidgetHostImpl::SetCursor(const WebCursor& cursor) { |
if (!view_) |
return; |
@@ -1689,6 +1702,15 @@ void RenderWidgetHostImpl::OnQueueSyntheticGesture( |
return; |
} |
+ if (gesture_packet.gesture_params()->GetGestureType() == |
+ SyntheticGestureParams::POINTER_ACTION) { |
+ QueueSyntheticPointerAction( |
+ *SyntheticPointerActionParams::Cast(gesture_packet.gesture_params()), |
+ base::Bind(&RenderWidgetHostImpl::OnSyntheticPointerActionCompleted, |
+ weak_factory_.GetWeakPtr())); |
+ return; |
+ } |
+ |
QueueSyntheticGesture( |
SyntheticGesture::Create(*gesture_packet.gesture_params()), |
base::Bind(&RenderWidgetHostImpl::OnSyntheticGestureCompleted, |
@@ -1953,6 +1975,15 @@ void RenderWidgetHostImpl::OnSyntheticGestureCompleted( |
Send(new InputMsg_SyntheticGestureCompleted(GetRoutingID())); |
} |
+void RenderWidgetHostImpl::OnSyntheticPointerActionCompleted( |
+ SyntheticGesture::Result result) { |
+ if (result == SyntheticGesture::POINTER_ACTION_FINISHED) { |
+ if (synthetic_gesture_controller_) |
+ synthetic_gesture_controller_->ResetSyntheticPointer(); |
+ Send(new InputMsg_SyntheticGestureCompleted(GetRoutingID())); |
+ } |
+} |
+ |
bool RenderWidgetHostImpl::ShouldDropInputEvents() const { |
return ignore_input_events_ || process_->IgnoreInputEvents() || !delegate_; |
} |