| 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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 return INPUT_EVENT_ACK_STATE_NOT_CONSUMED; | 75 return INPUT_EVENT_ACK_STATE_NOT_CONSUMED; |
| 76 } | 76 } |
| 77 virtual void IncrementInFlightEventCount() OVERRIDE {} | 77 virtual void IncrementInFlightEventCount() OVERRIDE {} |
| 78 virtual void DecrementInFlightEventCount() OVERRIDE {} | 78 virtual void DecrementInFlightEventCount() OVERRIDE {} |
| 79 virtual void OnHasTouchEventHandlers(bool has_handlers) OVERRIDE {} | 79 virtual void OnHasTouchEventHandlers(bool has_handlers) OVERRIDE {} |
| 80 virtual OverscrollController* GetOverscrollController() const OVERRIDE { | 80 virtual OverscrollController* GetOverscrollController() const OVERRIDE { |
| 81 return NULL; | 81 return NULL; |
| 82 } | 82 } |
| 83 virtual void DidFlush() OVERRIDE {} | 83 virtual void DidFlush() OVERRIDE {} |
| 84 virtual void SetNeedsFlush() OVERRIDE {} | 84 virtual void SetNeedsFlush() OVERRIDE {} |
| 85 virtual void DidOverscroll(const DidOverscrollParams& params) OVERRIDE {} |
| 85 }; | 86 }; |
| 86 | 87 |
| 87 class NullIPCSender : public IPC::Sender { | 88 class NullIPCSender : public IPC::Sender { |
| 88 public: | 89 public: |
| 89 NullIPCSender() : sent_count_(0) {} | 90 NullIPCSender() : sent_count_(0) {} |
| 90 virtual ~NullIPCSender() {} | 91 virtual ~NullIPCSender() {} |
| 91 | 92 |
| 92 virtual bool Send(IPC::Message* message) OVERRIDE { | 93 virtual bool Send(IPC::Message* message) OVERRIDE { |
| 93 delete message; | 94 delete message; |
| 94 ++sent_count_; | 95 ++sent_count_; |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 230 } | 231 } |
| 231 | 232 |
| 232 void SendEvent(const WebTouchEvent& touch, const ui::LatencyInfo& latency) { | 233 void SendEvent(const WebTouchEvent& touch, const ui::LatencyInfo& latency) { |
| 233 input_router_->SendTouchEvent(TouchEventWithLatencyInfo(touch, latency)); | 234 input_router_->SendTouchEvent(TouchEventWithLatencyInfo(touch, latency)); |
| 234 } | 235 } |
| 235 | 236 |
| 236 void SendEventAckIfNecessary(const blink::WebInputEvent& event, | 237 void SendEventAckIfNecessary(const blink::WebInputEvent& event, |
| 237 InputEventAckState ack_result) { | 238 InputEventAckState ack_result) { |
| 238 if (WebInputEventTraits::IgnoresAckDisposition(event)) | 239 if (WebInputEventTraits::IgnoresAckDisposition(event)) |
| 239 return; | 240 return; |
| 240 InputHostMsg_HandleInputEvent_ACK response( | 241 InputHostMsg_HandleInputEvent_ACK_Params ack; |
| 241 0, event.type, ack_result, ui::LatencyInfo()); | 242 ack.type = event.type; |
| 243 ack.state = ack_result; |
| 244 InputHostMsg_HandleInputEvent_ACK response(0, ack); |
| 242 input_router_->OnMessageReceived(response); | 245 input_router_->OnMessageReceived(response); |
| 243 } | 246 } |
| 244 | 247 |
| 245 void OnHasTouchEventHandlers(bool has_handlers) { | 248 void OnHasTouchEventHandlers(bool has_handlers) { |
| 246 input_router_->OnMessageReceived( | 249 input_router_->OnMessageReceived( |
| 247 ViewHostMsg_HasTouchEventHandlers(0, has_handlers)); | 250 ViewHostMsg_HasTouchEventHandlers(0, has_handlers)); |
| 248 } | 251 } |
| 249 | 252 |
| 250 size_t GetAndResetSentEventCount() { | 253 size_t GetAndResetSentEventCount() { |
| 251 return sender_->GetAndResetSentEventCount(); | 254 return sender_->GetAndResetSentEventCount(); |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 378 | 381 |
| 379 TEST_F(InputRouterImplPerfTest, TouchSwipeToGestureScroll) { | 382 TEST_F(InputRouterImplPerfTest, TouchSwipeToGestureScroll) { |
| 380 SimulateTouchAndScrollEventSequence("TouchSwipeToGestureScroll ", | 383 SimulateTouchAndScrollEventSequence("TouchSwipeToGestureScroll ", |
| 381 kDefaultSteps, | 384 kDefaultSteps, |
| 382 kDefaultOrigin, | 385 kDefaultOrigin, |
| 383 kDefaultDistance, | 386 kDefaultDistance, |
| 384 kDefaultIterations); | 387 kDefaultIterations); |
| 385 } | 388 } |
| 386 | 389 |
| 387 } // namespace content | 390 } // namespace content |
| OLD | NEW |