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

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

Issue 2341873002: Handle touchpad flings with passive event listeners on compositor thread. (Closed)
Patch Set: Created 4 years, 3 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: 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 b4e93ae46fbfcf47450ed2a6763d6c2d8d2fcf14..e1ebc38588dad79483207089a4135b0a36b1357d 100644
--- a/ui/events/blink/input_handler_proxy.cc
+++ b/ui/events/blink/input_handler_proxy.cc
@@ -21,6 +21,7 @@
#include "ui/events/blink/did_overscroll_params.h"
#include "ui/events/blink/input_handler_proxy_client.h"
#include "ui/events/blink/input_scroll_elasticity_controller.h"
+#include "ui/events/blink/web_input_event_traits.h"
#include "ui/events/latency_info.h"
#include "ui/gfx/geometry/point_conversions.h"
@@ -1230,12 +1231,10 @@ bool InputHandlerProxy::TouchpadFlingScroll(
input_handler_->GetEventListenerProperties(
cc::EventListenerClass::kMouseWheel);
switch (properties) {
- case cc::EventListenerProperties::kPassive:
- disposition = DID_HANDLE_NON_BLOCKING;
- break;
case cc::EventListenerProperties::kBlocking:
disposition = DID_NOT_HANDLE;
break;
+ case cc::EventListenerProperties::kPassive:
case cc::EventListenerProperties::kNone: {
WebMouseWheelEvent synthetic_wheel;
synthetic_wheel.type = WebInputEvent::MouseWheel;
@@ -1250,6 +1249,12 @@ bool InputHandlerProxy::TouchpadFlingScroll(
synthetic_wheel.modifiers = fling_parameters_.modifiers;
disposition = ScrollByMouseWheel(synthetic_wheel);
+
+ // Send the event over to the main thread.
+ if (disposition == DID_HANDLE_NON_BLOCKING) {
+ client_->DispatchNonBlockingEventToMainThread(
+ ui::WebInputEventTraits::Clone(synthetic_wheel));
+ }
break;
}
default:
@@ -1259,13 +1264,10 @@ bool InputHandlerProxy::TouchpadFlingScroll(
switch (disposition) {
case DID_HANDLE:
+ case DID_HANDLE_NON_BLOCKING:
return true;
case DROP_EVENT:
break;
- case DID_HANDLE_NON_BLOCKING:
- // TODO(dtapuska): Process the fling on the compositor thread
- // but post the events to the main thread; for now just pass it to the
- // main thread.
case DID_NOT_HANDLE:
TRACE_EVENT_INSTANT0("input",
"InputHandlerProxy::scrollBy::AbortFling",

Powered by Google App Engine
This is Rietveld 408576698