Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(786)

Unified Diff: content/browser/renderer_host/render_widget_host_impl.cc

Issue 1884883005: Prepare SyntheticPointerAction to handle touch actions for multiple fingers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add tests for mouse and change type of params_list Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 ddd9ebaa1c6b72f3924cc1e20c85aa5f902e3a21..90dd7ff1a0e593fc8ed860216d27ac9a7eb58722 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_) {
tdresser 2016/05/31 13:44:26 Should this ever run if !view_? It might be easie
lanwei 2016/06/02 13:26:27 I feel if the synthetic_gesture_controller is not
tdresser 2016/06/02 13:39:24 Is there ever a case where the controller is non-n
+ 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_;
}

Powered by Google App Engine
This is Rietveld 408576698