OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "base/basictypes.h" | 5 #include "base/basictypes.h" |
6 #include "base/memory/scoped_ptr.h" | 6 #include "base/memory/scoped_ptr.h" |
7 #include "content/browser/renderer_host/input/input_ack_handler.h" | 7 #include "content/browser/renderer_host/input/input_ack_handler.h" |
8 #include "content/browser/renderer_host/input/input_router_client.h" | 8 #include "content/browser/renderer_host/input/input_router_client.h" |
9 #include "content/browser/renderer_host/input/input_router_impl.h" | 9 #include "content/browser/renderer_host/input/input_router_impl.h" |
10 #include "content/common/input/web_input_event_traits.h" | 10 #include "content/common/input/web_input_event_traits.h" |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 input_router_->SendGestureEvent( | 226 input_router_->SendGestureEvent( |
227 GestureEventWithLatencyInfo(gesture, latency)); | 227 GestureEventWithLatencyInfo(gesture, latency)); |
228 } | 228 } |
229 | 229 |
230 void SendEvent(const WebTouchEvent& touch, const ui::LatencyInfo& latency) { | 230 void SendEvent(const WebTouchEvent& touch, const ui::LatencyInfo& latency) { |
231 input_router_->SendTouchEvent(TouchEventWithLatencyInfo(touch, latency)); | 231 input_router_->SendTouchEvent(TouchEventWithLatencyInfo(touch, latency)); |
232 } | 232 } |
233 | 233 |
234 void SendEventAckIfNecessary(const blink::WebInputEvent& event, | 234 void SendEventAckIfNecessary(const blink::WebInputEvent& event, |
235 InputEventAckState ack_result) { | 235 InputEventAckState ack_result) { |
236 if (WebInputEventTraits::IgnoresAckDisposition(event)) | 236 if (!WebInputEventTraits::WillReceiveAckFromRenderer(event)) |
237 return; | 237 return; |
238 InputHostMsg_HandleInputEvent_ACK_Params ack; | 238 InputEventAck ack(event.type, ack_result); |
239 ack.type = event.type; | |
240 ack.state = ack_result; | |
241 InputHostMsg_HandleInputEvent_ACK response(0, ack); | 239 InputHostMsg_HandleInputEvent_ACK response(0, ack); |
242 input_router_->OnMessageReceived(response); | 240 input_router_->OnMessageReceived(response); |
243 } | 241 } |
244 | 242 |
245 void OnHasTouchEventHandlers(bool has_handlers) { | 243 void OnHasTouchEventHandlers(bool has_handlers) { |
246 input_router_->OnMessageReceived( | 244 input_router_->OnMessageReceived( |
247 ViewHostMsg_HasTouchEventHandlers(0, has_handlers)); | 245 ViewHostMsg_HasTouchEventHandlers(0, has_handlers)); |
248 } | 246 } |
249 | 247 |
250 size_t GetAndResetSentEventCount() { | 248 size_t GetAndResetSentEventCount() { |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
376 | 374 |
377 TEST_F(InputRouterImplPerfTest, TouchSwipeToGestureScroll) { | 375 TEST_F(InputRouterImplPerfTest, TouchSwipeToGestureScroll) { |
378 SimulateTouchAndScrollEventSequence("TouchSwipeToGestureScroll ", | 376 SimulateTouchAndScrollEventSequence("TouchSwipeToGestureScroll ", |
379 kDefaultSteps, | 377 kDefaultSteps, |
380 kDefaultOrigin, | 378 kDefaultOrigin, |
381 kDefaultDistance, | 379 kDefaultDistance, |
382 kDefaultIterations); | 380 kDefaultIterations); |
383 } | 381 } |
384 | 382 |
385 } // namespace content | 383 } // namespace content |
OLD | NEW |