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

Unified Diff: content/renderer/input/main_thread_event_queue.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 side-by-side diff with in-line comments
Download patch
Index: content/renderer/input/main_thread_event_queue.cc
diff --git a/content/renderer/input/main_thread_event_queue.cc b/content/renderer/input/main_thread_event_queue.cc
index 721f538f9fc8e2a43812fe041b062914d93962c4..15c83500253cecaca40140ffc35b5668a45f03c1 100644
--- a/content/renderer/input/main_thread_event_queue.cc
+++ b/content/renderer/input/main_thread_event_queue.cc
@@ -30,21 +30,33 @@ bool MainThreadEventQueue::HandleEvent(
: DISPATCH_TYPE_BLOCKING_NOTIFY_MAIN;
if (event->type == blink::WebInputEvent::MouseWheel) {
+ PendingMouseWheelEvent modified_dispatch_type_event =
+ PendingMouseWheelEvent(
+ *static_cast<const blink::WebMouseWheelEvent*>(event), latency,
+ dispatch_type);
+
+ // Adjust the |dispatchType| on the event since the compositor
+ // determined all event listeners are passive.
+ if (non_blocking) {
+ modified_dispatch_type_event.event.dispatchType =
+ blink::WebInputEvent::ListenersNonBlockingPassive;
+ }
+
if (wheel_events_.state() == WebInputEventQueueState::ITEM_PENDING) {
- wheel_events_.Queue(PendingMouseWheelEvent(
- *static_cast<const blink::WebMouseWheelEvent*>(event), latency,
- dispatch_type));
+ wheel_events_.Queue(modified_dispatch_type_event);
} else {
if (non_blocking) {
wheel_events_.set_state(WebInputEventQueueState::ITEM_PENDING);
- client_->SendEventToMainThread(routing_id_, event, latency,
- dispatch_type);
+ client_->SendEventToMainThread(routing_id_,
+ &modified_dispatch_type_event.event,
+ latency, dispatch_type);
} else {
// If there is nothing in the event queue and the event is
// blocking pass the |original_dispatch_type| to avoid
// having the main thread call us back as an optimization.
- client_->SendEventToMainThread(routing_id_, event, latency,
- original_dispatch_type);
+ client_->SendEventToMainThread(routing_id_,
+ &modified_dispatch_type_event.event,
+ latency, original_dispatch_type);
}
}
} else if (blink::WebInputEvent::isTouchEventType(event->type)) {
« no previous file with comments | « content/renderer/input/input_event_filter_unittest.cc ('k') | content/renderer/input/main_thread_event_queue_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698