OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/renderer/input/render_widget_input_handler.h" | 5 #include "content/renderer/input/render_widget_input_handler.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
320 // TODO(dtapuska): Use the input_event.timeStampSeconds as the start | 320 // TODO(dtapuska): Use the input_event.timeStampSeconds as the start |
321 // ideally this should be when the event was sent by the compositor to the | 321 // ideally this should be when the event was sent by the compositor to the |
322 // renderer. crbug.com/565348 | 322 // renderer. crbug.com/565348 |
323 if (input_event.type == WebInputEvent::TouchStart || | 323 if (input_event.type == WebInputEvent::TouchStart || |
324 input_event.type == WebInputEvent::TouchMove || | 324 input_event.type == WebInputEvent::TouchMove || |
325 input_event.type == WebInputEvent::TouchEnd) { | 325 input_event.type == WebInputEvent::TouchEnd) { |
326 LogPassiveEventListenersUma( | 326 LogPassiveEventListenersUma( |
327 processed, static_cast<const WebTouchEvent&>(input_event).dispatchType, | 327 processed, static_cast<const WebTouchEvent&>(input_event).dispatchType, |
328 input_event.timeStampSeconds, latency_info); | 328 input_event.timeStampSeconds, latency_info); |
329 } else if (input_event.type == WebInputEvent::MouseWheel) { | 329 } else if (input_event.type == WebInputEvent::MouseWheel) { |
330 bool non_blocking = | 330 LogPassiveEventListenersUma( |
331 dispatch_type == | 331 processed, |
332 InputEventDispatchType::DISPATCH_TYPE_NON_BLOCKING_NOTIFY_MAIN || | 332 static_cast<const WebMouseWheelEvent&>(input_event).dispatchType, |
333 dispatch_type == InputEventDispatchType::DISPATCH_TYPE_NON_BLOCKING; | 333 input_event.timeStampSeconds, latency_info); |
334 LogPassiveEventListenersUma(processed, | |
335 non_blocking ? WebInputEvent::EventNonBlocking | |
336 : WebInputEvent::Blocking, | |
337 input_event.timeStampSeconds, latency_info); | |
338 } | 334 } |
339 | 335 |
340 // If this RawKeyDown event corresponds to a browser keyboard shortcut and | 336 // If this RawKeyDown event corresponds to a browser keyboard shortcut and |
341 // it's not processed by webkit, then we need to suppress the upcoming Char | 337 // it's not processed by webkit, then we need to suppress the upcoming Char |
342 // events. | 338 // events. |
343 bool is_keyboard_shortcut = | 339 bool is_keyboard_shortcut = |
344 input_event.type == WebInputEvent::RawKeyDown && | 340 input_event.type == WebInputEvent::RawKeyDown && |
345 static_cast<const WebKeyboardEvent&>(input_event).isBrowserShortcut; | 341 static_cast<const WebKeyboardEvent&>(input_event).isBrowserShortcut; |
346 if (processed == WebInputEventResult::NotHandled && is_keyboard_shortcut) | 342 if (processed == WebInputEventResult::NotHandled && is_keyboard_shortcut) |
347 suppress_next_char_events_ = true; | 343 suppress_next_char_events_ = true; |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
545 if (pending_input_event_ack_) { | 541 if (pending_input_event_ack_) { |
546 TRACE_EVENT_ASYNC_END0("input", | 542 TRACE_EVENT_ASYNC_END0("input", |
547 "RenderWidgetInputHandler::ThrottledInputEventAck", | 543 "RenderWidgetInputHandler::ThrottledInputEventAck", |
548 pending_input_event_ack_.get()); | 544 pending_input_event_ack_.get()); |
549 delegate_->OnInputEventAck(std::move(pending_input_event_ack_)); | 545 delegate_->OnInputEventAck(std::move(pending_input_event_ack_)); |
550 } | 546 } |
551 total_input_handling_time_this_frame_ = base::TimeDelta(); | 547 total_input_handling_time_this_frame_ = base::TimeDelta(); |
552 } | 548 } |
553 | 549 |
554 } // namespace content | 550 } // namespace content |
OLD | NEW |