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 "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
(...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
440 | 440 |
441 if (OfferToOverscrollController(input_event, latency_info)) | 441 if (OfferToOverscrollController(input_event, latency_info)) |
442 return; | 442 return; |
443 | 443 |
444 if (OfferToClient(input_event, latency_info)) | 444 if (OfferToClient(input_event, latency_info)) |
445 return; | 445 return; |
446 | 446 |
447 OfferToRenderer(input_event, latency_info, is_keyboard_shortcut); | 447 OfferToRenderer(input_event, latency_info, is_keyboard_shortcut); |
448 | 448 |
449 // If we don't care about the ack disposition, send the ack immediately. | 449 // If we don't care about the ack disposition, send the ack immediately. |
450 if (WebInputEventTraits::IgnoresAckDisposition(input_event.type)) { | 450 if (WebInputEventTraits::IgnoresAckDisposition(input_event)) { |
451 ProcessInputEventAck(input_event.type, | 451 ProcessInputEventAck(input_event.type, |
452 INPUT_EVENT_ACK_STATE_IGNORED, | 452 INPUT_EVENT_ACK_STATE_IGNORED, |
453 latency_info, | 453 latency_info, |
454 IGNORING_DISPOSITION); | 454 IGNORING_DISPOSITION); |
455 } | 455 } |
456 } | 456 } |
457 | 457 |
458 bool InputRouterImpl::OfferToOverscrollController( | 458 bool InputRouterImpl::OfferToOverscrollController( |
459 const WebInputEvent& input_event, | 459 const WebInputEvent& input_event, |
460 const ui::LatencyInfo& latency_info) { | 460 const ui::LatencyInfo& latency_info) { |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
517 } | 517 } |
518 | 518 |
519 bool InputRouterImpl::OfferToRenderer(const WebInputEvent& input_event, | 519 bool InputRouterImpl::OfferToRenderer(const WebInputEvent& input_event, |
520 const ui::LatencyInfo& latency_info, | 520 const ui::LatencyInfo& latency_info, |
521 bool is_keyboard_shortcut) { | 521 bool is_keyboard_shortcut) { |
522 if (Send(new InputMsg_HandleInputEvent( | 522 if (Send(new InputMsg_HandleInputEvent( |
523 routing_id(), &input_event, latency_info, is_keyboard_shortcut))) { | 523 routing_id(), &input_event, latency_info, is_keyboard_shortcut))) { |
524 // Ack messages for ignored ack event types are not required, and might | 524 // Ack messages for ignored ack event types are not required, and might |
525 // never be sent by the renderer. Consequently, such event types should not | 525 // never be sent by the renderer. Consequently, such event types should not |
526 // affect event timing or in-flight event count metrics. | 526 // affect event timing or in-flight event count metrics. |
527 if (!WebInputEventTraits::IgnoresAckDisposition(input_event.type)) { | 527 if (!WebInputEventTraits::IgnoresAckDisposition(input_event)) { |
528 input_event_start_time_ = TimeTicks::Now(); | 528 input_event_start_time_ = TimeTicks::Now(); |
529 client_->IncrementInFlightEventCount(); | 529 client_->IncrementInFlightEventCount(); |
530 } | 530 } |
531 return true; | 531 return true; |
532 } | 532 } |
533 return false; | 533 return false; |
534 } | 534 } |
535 | 535 |
536 void InputRouterImpl::OnInputEventAck(WebInputEvent::Type event_type, | 536 void InputRouterImpl::OnInputEventAck(WebInputEvent::Type event_type, |
537 InputEventAckState ack_result, | 537 InputEventAckState ack_result, |
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
849 select_range_pending_ || | 849 select_range_pending_ || |
850 move_caret_pending_; | 850 move_caret_pending_; |
851 } | 851 } |
852 | 852 |
853 bool InputRouterImpl::IsInOverscrollGesture() const { | 853 bool InputRouterImpl::IsInOverscrollGesture() const { |
854 OverscrollController* controller = client_->GetOverscrollController(); | 854 OverscrollController* controller = client_->GetOverscrollController(); |
855 return controller && controller->overscroll_mode() != OVERSCROLL_NONE; | 855 return controller && controller->overscroll_mode() != OVERSCROLL_NONE; |
856 } | 856 } |
857 | 857 |
858 } // namespace content | 858 } // namespace content |
OLD | NEW |