Index: content/common/input/web_input_event_traits.cc |
diff --git a/content/common/input/web_input_event_traits.cc b/content/common/input/web_input_event_traits.cc |
index 6ca962b5720d9741d2b6bc4d4d251f7e9a86b9ec..d7a0b7a046e19d32404a7e141e2f3710638fe22c 100644 |
--- a/content/common/input/web_input_event_traits.cc |
+++ b/content/common/input/web_input_event_traits.cc |
@@ -9,6 +9,7 @@ |
#include "base/logging.h" |
#include "base/strings/stringprintf.h" |
+#include "content/common/input_messages.h" |
using base::StringAppendF; |
using base::SStringPrintf; |
@@ -487,4 +488,32 @@ bool WebInputEventTraits::IgnoresAckDisposition(const WebInputEvent& event) { |
} |
} |
+scoped_ptr<IPC::Message> WebInputEventTraits::CreateAckIfNecessary( |
+ const blink::WebInputEvent& event, |
+ const content::InputEventAckState ack_state, |
+ const ui::LatencyInfo& latency_info, |
+ scoped_ptr<DidOverscrollParams> overscroll_params, |
+ int routing_id) { |
+ scoped_ptr<IPC::Message> response; |
+ if (event.type == WebInputEvent::TouchMove) { |
+ const WebTouchEvent& touch = static_cast<const WebTouchEvent&>(event); |
+ if (!touch.cancelable) { |
+ response = scoped_ptr<IPC::Message>( |
+ new InputHostMsg_HandleUncancelableTouchMoveEvent_ACK(routing_id)); |
+ } |
+ } |
+ |
+ const bool send_ack = !WebInputEventTraits::IgnoresAckDisposition(event); |
+ if (send_ack) { |
tdresser
2015/03/31 14:44:07
Could we end up overwriting response here?
We sho
lanwei
2015/04/01 13:14:21
Done.
|
+ InputHostMsg_HandleInputEvent_ACK_Params ack; |
+ ack.type = event.type; |
+ ack.state = ack_state; |
+ ack.latency = latency_info; |
+ ack.overscroll = overscroll_params.Pass(); |
+ response = scoped_ptr<IPC::Message>( |
+ new InputHostMsg_HandleInputEvent_ACK(routing_id, ack)); |
+ } |
+ return response.Pass(); |
+} |
+ |
} // namespace content |