Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(339)

Side by Side Diff: content/renderer/input/render_widget_input_handler.cc

Issue 1894363004: Articulate the cancel behavior in WebMouseWheelEvent. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master_all_passive
Patch Set: Rebase Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 310 matching lines...) Expand 10 before | Expand all | Expand 10 after
321 // TODO(dtapuska): Use the input_event.timeStampSeconds as the start 321 // TODO(dtapuska): Use the input_event.timeStampSeconds as the start
322 // ideally this should be when the event was sent by the compositor to the 322 // ideally this should be when the event was sent by the compositor to the
323 // renderer. crbug.com/565348 323 // renderer. crbug.com/565348
324 if (input_event.type == WebInputEvent::TouchStart || 324 if (input_event.type == WebInputEvent::TouchStart ||
325 input_event.type == WebInputEvent::TouchMove || 325 input_event.type == WebInputEvent::TouchMove ||
326 input_event.type == WebInputEvent::TouchEnd) { 326 input_event.type == WebInputEvent::TouchEnd) {
327 LogPassiveEventListenersUma( 327 LogPassiveEventListenersUma(
328 processed, static_cast<const WebTouchEvent&>(input_event).dispatchType, 328 processed, static_cast<const WebTouchEvent&>(input_event).dispatchType,
329 input_event.timeStampSeconds, latency_info); 329 input_event.timeStampSeconds, latency_info);
330 } else if (input_event.type == WebInputEvent::MouseWheel) { 330 } else if (input_event.type == WebInputEvent::MouseWheel) {
331 bool non_blocking = 331 LogPassiveEventListenersUma(
332 dispatch_type == 332 processed,
333 InputEventDispatchType::DISPATCH_TYPE_NON_BLOCKING_NOTIFY_MAIN || 333 static_cast<const WebMouseWheelEvent&>(input_event).dispatchType,
334 dispatch_type == InputEventDispatchType::DISPATCH_TYPE_NON_BLOCKING; 334 input_event.timeStampSeconds, latency_info);
335 LogPassiveEventListenersUma(processed,
336 non_blocking ? WebInputEvent::EventNonBlocking
337 : WebInputEvent::Blocking,
338 input_event.timeStampSeconds, latency_info);
339 } 335 }
340 336
341 // If this RawKeyDown event corresponds to a browser keyboard shortcut and 337 // If this RawKeyDown event corresponds to a browser keyboard shortcut and
342 // it's not processed by webkit, then we need to suppress the upcoming Char 338 // it's not processed by webkit, then we need to suppress the upcoming Char
343 // events. 339 // events.
344 bool is_keyboard_shortcut = 340 bool is_keyboard_shortcut =
345 input_event.type == WebInputEvent::RawKeyDown && 341 input_event.type == WebInputEvent::RawKeyDown &&
346 static_cast<const WebKeyboardEvent&>(input_event).isBrowserShortcut; 342 static_cast<const WebKeyboardEvent&>(input_event).isBrowserShortcut;
347 if (processed == WebInputEventResult::NotHandled && is_keyboard_shortcut) 343 if (processed == WebInputEventResult::NotHandled && is_keyboard_shortcut)
348 suppress_next_char_events_ = true; 344 suppress_next_char_events_ = true;
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
546 if (pending_input_event_ack_) { 542 if (pending_input_event_ack_) {
547 TRACE_EVENT_ASYNC_END0("input", 543 TRACE_EVENT_ASYNC_END0("input",
548 "RenderWidgetInputHandler::ThrottledInputEventAck", 544 "RenderWidgetInputHandler::ThrottledInputEventAck",
549 pending_input_event_ack_.get()); 545 pending_input_event_ack_.get());
550 delegate_->OnInputEventAck(std::move(pending_input_event_ack_)); 546 delegate_->OnInputEventAck(std::move(pending_input_event_ack_));
551 } 547 }
552 total_input_handling_time_this_frame_ = base::TimeDelta(); 548 total_input_handling_time_this_frame_ = base::TimeDelta();
553 } 549 }
554 550
555 } // namespace content 551 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/input/main_thread_event_queue_unittest.cc ('k') | third_party/WebKit/Source/core/events/WheelEvent.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698