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

Unified Diff: cc/layers/layer_impl.cc

Issue 1577263004: Communicate whether passive event listeners exist to cc. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master_wheel_passive_listeners
Patch Set: Fix nits Created 4 years, 10 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 | « cc/input/input_handler.h ('k') | cc/proto/layer_tree_host.proto » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/layer_impl.cc
diff --git a/cc/layers/layer_impl.cc b/cc/layers/layer_impl.cc
index 708c8d28467ca6eb37ea56ad98485c1bf38cab44..485f54d0afb73048fe8420fc371dc7f8531efa56 100644
--- a/cc/layers/layer_impl.cc
+++ b/cc/layers/layer_impl.cc
@@ -554,13 +554,19 @@ InputHandler::ScrollStatus LayerImpl::TryScroll(
}
}
- if ((type == InputHandler::WHEEL || type == InputHandler::ANIMATED_WHEEL) &&
- layer_tree_impl_->have_wheel_event_handlers()) {
- TRACE_EVENT0("cc", "LayerImpl::tryScroll: Failed WheelEventHandlers");
- scroll_status.thread = InputHandler::SCROLL_ON_MAIN_THREAD;
- scroll_status.main_thread_scrolling_reasons =
- MainThreadScrollingReason::kEventHandlers;
- return scroll_status;
+ if (type == InputHandler::WHEEL || type == InputHandler::ANIMATED_WHEEL) {
+ EventListenerProperties event_properties =
+ layer_tree_impl_->event_listener_properties(
+ EventListenerClass::kMouseWheel);
+ if (event_properties == EventListenerProperties::kBlocking ||
+ (!layer_tree_impl_->settings().use_mouse_wheel_gestures &&
+ event_properties == EventListenerProperties::kPassive)) {
+ TRACE_EVENT0("cc", "LayerImpl::tryScroll: Failed WheelEventHandlers");
+ scroll_status.thread = InputHandler::SCROLL_ON_MAIN_THREAD;
+ scroll_status.main_thread_scrolling_reasons =
+ MainThreadScrollingReason::kEventHandlers;
+ return scroll_status;
+ }
}
if (!scrollable()) {
« no previous file with comments | « cc/input/input_handler.h ('k') | cc/proto/layer_tree_host.proto » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698