| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "content/browser/renderer_host/input/input_router_impl.h" | 5 #include "content/browser/renderer_host/input/input_router_impl.h" |
| 6 | 6 |
| 7 #include <math.h> | 7 #include <math.h> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 namespace content { | 45 namespace content { |
| 46 namespace { | 46 namespace { |
| 47 | 47 |
| 48 const char* GetEventAckName(InputEventAckState ack_result) { | 48 const char* GetEventAckName(InputEventAckState ack_result) { |
| 49 switch(ack_result) { | 49 switch(ack_result) { |
| 50 case INPUT_EVENT_ACK_STATE_UNKNOWN: return "UNKNOWN"; | 50 case INPUT_EVENT_ACK_STATE_UNKNOWN: return "UNKNOWN"; |
| 51 case INPUT_EVENT_ACK_STATE_CONSUMED: return "CONSUMED"; | 51 case INPUT_EVENT_ACK_STATE_CONSUMED: return "CONSUMED"; |
| 52 case INPUT_EVENT_ACK_STATE_NOT_CONSUMED: return "NOT_CONSUMED"; | 52 case INPUT_EVENT_ACK_STATE_NOT_CONSUMED: return "NOT_CONSUMED"; |
| 53 case INPUT_EVENT_ACK_STATE_NO_CONSUMER_EXISTS: return "NO_CONSUMER_EXISTS"; | 53 case INPUT_EVENT_ACK_STATE_NO_CONSUMER_EXISTS: return "NO_CONSUMER_EXISTS"; |
| 54 case INPUT_EVENT_ACK_STATE_IGNORED: return "IGNORED"; | 54 case INPUT_EVENT_ACK_STATE_IGNORED: return "IGNORED"; |
| 55 case INPUT_EVENT_ACK_STATE_SET_NON_BLOCKING: |
| 56 return "SET_NON_BLOCKING"; |
| 55 } | 57 } |
| 56 DLOG(WARNING) << "Unhandled InputEventAckState in GetEventAckName."; | 58 DLOG(WARNING) << "Unhandled InputEventAckState in GetEventAckName."; |
| 57 return ""; | 59 return ""; |
| 58 } | 60 } |
| 59 | 61 |
| 60 bool UseGestureBasedWheelScrolling() { | 62 bool UseGestureBasedWheelScrolling() { |
| 61 return base::CommandLine::ForCurrentProcess()->HasSwitch( | 63 return base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 62 switches::kEnableWheelGestures); | 64 switches::kEnableWheelGestures); |
| 63 } | 65 } |
| 64 | 66 |
| (...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 403 } | 405 } |
| 404 | 406 |
| 405 bool InputRouterImpl::OfferToRenderer(const WebInputEvent& input_event, | 407 bool InputRouterImpl::OfferToRenderer(const WebInputEvent& input_event, |
| 406 const ui::LatencyInfo& latency_info) { | 408 const ui::LatencyInfo& latency_info) { |
| 407 scoped_ptr<blink::WebInputEvent> event_in_viewport = | 409 scoped_ptr<blink::WebInputEvent> event_in_viewport = |
| 408 ConvertWebInputEventToViewport(input_event, device_scale_factor_); | 410 ConvertWebInputEventToViewport(input_event, device_scale_factor_); |
| 409 const WebInputEvent* event_to_send = | 411 const WebInputEvent* event_to_send = |
| 410 event_in_viewport ? event_in_viewport.get() : &input_event; | 412 event_in_viewport ? event_in_viewport.get() : &input_event; |
| 411 | 413 |
| 412 if (Send(new InputMsg_HandleInputEvent(routing_id(), event_to_send, | 414 if (Send(new InputMsg_HandleInputEvent(routing_id(), event_to_send, |
| 413 latency_info))) { | 415 latency_info, false))) { |
| 414 // Ack messages for ignored ack event types should never be sent by the | 416 // Ack messages for ignored ack event types should never be sent by the |
| 415 // renderer. Consequently, such event types should not affect event time | 417 // renderer. Consequently, such event types should not affect event time |
| 416 // or in-flight event count metrics. | 418 // or in-flight event count metrics. |
| 417 if (WebInputEventTraits::WillReceiveAckFromRenderer(*event_to_send)) { | 419 if (WebInputEventTraits::WillReceiveAckFromRenderer(*event_to_send)) { |
| 418 input_event_start_time_ = TimeTicks::Now(); | 420 input_event_start_time_ = TimeTicks::Now(); |
| 419 client_->IncrementInFlightEventCount(); | 421 client_->IncrementInFlightEventCount(); |
| 420 } | 422 } |
| 421 return true; | 423 return true; |
| 422 } | 424 } |
| 423 return false; | 425 return false; |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 616 return; | 618 return; |
| 617 | 619 |
| 618 if (HasPendingEvents()) | 620 if (HasPendingEvents()) |
| 619 return; | 621 return; |
| 620 | 622 |
| 621 flush_requested_ = false; | 623 flush_requested_ = false; |
| 622 client_->DidFlush(); | 624 client_->DidFlush(); |
| 623 } | 625 } |
| 624 | 626 |
| 625 } // namespace content | 627 } // namespace content |
| OLD | NEW |