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

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

Issue 375863005: Touch emulator: allow multiple touch streams. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed comments, switched to sequence_count Created 6 years, 5 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 1c1eb3b6e9f1ba04f3b1d4bd43c86a8c6e943278..2dab2072b81d5b6e3f2412e869da2ef7ebd0adeb 100644
--- a/content/browser/renderer_host/render_widget_host_impl.cc
+++ b/content/browser/renderer_host/render_widget_host_impl.cc
@@ -964,9 +964,13 @@ void RenderWidgetHostImpl::ForwardGestureEventWithLatencyInfo(
input_router_->SendGestureEvent(gesture_with_latency);
}
-void RenderWidgetHostImpl::ForwardTouchEvent(
+void RenderWidgetHostImpl::ForwardEmulatedTouchEvent(
const blink::WebTouchEvent& touch_event) {
- ForwardTouchEventWithLatencyInfo(touch_event, ui::LatencyInfo());
+ TRACE_EVENT0("input", "RenderWidgetHostImpl::ForwardEmulatedTouchEvent");
+ ui::LatencyInfo latency_info =
+ CreateRWHLatencyInfoIfNotExist(NULL, touch_event.type);
+ TouchEventWithLatencyInfo touch_with_latency(touch_event, latency_info);
+ input_router_->SendTouchEvent(touch_with_latency);
}
void RenderWidgetHostImpl::ForwardTouchEventWithLatencyInfo(
@@ -980,6 +984,16 @@ void RenderWidgetHostImpl::ForwardTouchEventWithLatencyInfo(
ui::LatencyInfo latency_info =
CreateRWHLatencyInfoIfNotExist(&ui_latency, touch_event.type);
TouchEventWithLatencyInfo touch_with_latency(touch_event, latency_info);
+
+ if (touch_emulator_ &&
+ touch_emulator_->HandleTouchEvent(touch_with_latency.event)) {
+ if (view_) {
+ view_->ProcessAckedTouchEvent(
+ touch_with_latency, INPUT_EVENT_ACK_STATE_CONSUMED);
+ }
+ return;
+ }
+
input_router_->SendTouchEvent(touch_with_latency);
}
@@ -1896,8 +1910,10 @@ void RenderWidgetHostImpl::OnTouchEventAck(
}
ComputeTouchLatency(touch_event.latency);
- if (touch_emulator_ && touch_emulator_->HandleTouchEventAck(ack_result))
+ if (touch_emulator_ &&
+ touch_emulator_->HandleTouchEventAck(event.event, ack_result)) {
return;
+ }
if (view_)
view_->ProcessAckedTouchEvent(touch_event, ack_result);
« no previous file with comments | « content/browser/renderer_host/render_widget_host_impl.h ('k') | content/common/input/web_touch_event_traits.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698