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

Unified Diff: ui/events/blink/input_handler_proxy.cc

Issue 2943133002: Async Wheel Event with only the first one cancellable behind a flag. (Closed)
Patch Set: 'k' removed from constant string Created 3 years, 6 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
« no previous file with comments | « ui/events/blink/blink_event_util.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/blink/input_handler_proxy.cc
diff --git a/ui/events/blink/input_handler_proxy.cc b/ui/events/blink/input_handler_proxy.cc
index 0f26dd9f7641c7c7fd8e21dd283b3544c2f515bc..f1ce98636b9993ddd62f92efa2b578f0f47dcae7 100644
--- a/ui/events/blink/input_handler_proxy.cc
+++ b/ui/events/blink/input_handler_proxy.cc
@@ -678,6 +678,24 @@ InputHandlerProxy::EventDisposition InputHandlerProxy::HandleMouseWheel(
CancelCurrentFling();
InputHandlerProxy::EventDisposition result = DROP_EVENT;
+
+ if (wheel_event.dispatch_type == WebInputEvent::kEventNonBlocking) {
+ // The first wheel event in the sequence should be cancellable.
+ DCHECK(wheel_event.phase != WebMouseWheelEvent::kPhaseBegan);
+
+ DCHECK(mouse_wheel_result_ != kEventDispositionUndefined);
+ result = static_cast<EventDisposition>(mouse_wheel_result_);
+
+ if (wheel_event.phase == WebMouseWheelEvent::kPhaseEnded ||
+ wheel_event.phase == WebMouseWheelEvent::kPhaseCancelled ||
+ wheel_event.momentum_phase == WebMouseWheelEvent::kPhaseEnded ||
+ wheel_event.momentum_phase == WebMouseWheelEvent::kPhaseCancelled) {
+ mouse_wheel_result_ = kEventDispositionUndefined;
+ }
+ if (mouse_wheel_result_ != kEventDispositionUndefined)
+ return result;
+ }
+
cc::EventListenerProperties properties =
input_handler_->GetEventListenerProperties(
cc::EventListenerClass::kMouseWheel);
« no previous file with comments | « ui/events/blink/blink_event_util.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698