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

Unified Diff: content/renderer/gpu/render_widget_compositor.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: Rebase 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
Index: content/renderer/gpu/render_widget_compositor.cc
diff --git a/content/renderer/gpu/render_widget_compositor.cc b/content/renderer/gpu/render_widget_compositor.cc
index 9bd5b80d54326a12196884b888e1aa871315cae5..063e2dd6ea31f3ce53993ec1894aa9d34b6787ad 100644
--- a/content/renderer/gpu/render_widget_compositor.cc
+++ b/content/renderer/gpu/render_widget_compositor.cc
@@ -257,6 +257,9 @@ void RenderWidgetCompositor::Initialize(float device_scale_factor) {
blink::WebRuntimeFeatures::enableCompositorAnimationTimelines(
settings.use_compositor_animation_timelines);
+ settings.use_mouse_wheel_gestures =
+ cmd->HasSwitch(switches::kEnableWheelGestures);
+
settings.default_tile_size = CalculateDefaultTileSize(device_scale_factor);
if (cmd->HasSwitch(switches::kDefaultTileWidth)) {
int tile_width = 0;
@@ -743,12 +746,42 @@ void RenderWidgetCompositor::clearSelection() {
layer_tree_host_->RegisterSelection(empty_selection);
}
-void RenderWidgetCompositor::setHaveWheelEventHandlers(bool value) {
- layer_tree_host_->SetHaveWheelEventHandlers(value);
-}
-
-bool RenderWidgetCompositor::haveWheelEventHandlers() const {
- return layer_tree_host_->have_wheel_event_handlers();
+static_assert(
+ static_cast<cc::EventListenerClass>(blink::WebEventListenerClass::Touch) ==
+ cc::EventListenerClass::kTouch,
+ "EventListenerClass and WebEventListenerClass enums must match");
+static_assert(static_cast<cc::EventListenerClass>(
+ blink::WebEventListenerClass::MouseWheel) ==
+ cc::EventListenerClass::kMouseWheel,
+ "EventListenerClass and WebEventListenerClass enums must match");
+
+static_assert(static_cast<cc::EventListenerProperties>(
+ blink::WebEventListenerProperties::Nothing) ==
+ cc::EventListenerProperties::kNone,
+ "EventListener and WebEventListener enums must match");
+static_assert(static_cast<cc::EventListenerProperties>(
+ blink::WebEventListenerProperties::Passive) ==
+ cc::EventListenerProperties::kPassive,
+ "EventListener and WebEventListener enums must match");
+static_assert(static_cast<cc::EventListenerProperties>(
+ blink::WebEventListenerProperties::Blocking) ==
+ cc::EventListenerProperties::kBlocking,
+ "EventListener and WebEventListener enums must match");
+
+void RenderWidgetCompositor::setEventListenerProperties(
+ blink::WebEventListenerClass eventClass,
+ blink::WebEventListenerProperties properties) {
+ layer_tree_host_->SetEventListenerProperties(
+ static_cast<cc::EventListenerClass>(eventClass),
+ static_cast<cc::EventListenerProperties>(properties));
+}
+
+blink::WebEventListenerProperties
+RenderWidgetCompositor::eventListenerProperties(
+ blink::WebEventListenerClass event_class) const {
+ return static_cast<blink::WebEventListenerProperties>(
+ layer_tree_host_->event_listener_properties(
+ static_cast<cc::EventListenerClass>(event_class)));
}
void RenderWidgetCompositor::setHaveScrollEventHandlers(bool has_handlers) {

Powered by Google App Engine
This is Rietveld 408576698