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

Unified Diff: cc/trees/layer_tree_host.cc

Issue 1646603004: Move scroll event handlers from layer to layer tree view. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master_cc_listeners
Patch Set: Rebase against scroll blocks on Created 4 years, 11 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: cc/trees/layer_tree_host.cc
diff --git a/cc/trees/layer_tree_host.cc b/cc/trees/layer_tree_host.cc
index dfacf9e00f171ca238f566a22b205ce6fcc62f9f..9f1bee298bfcc28257a9a058b6ac94a931c2cef5 100644
--- a/cc/trees/layer_tree_host.cc
+++ b/cc/trees/layer_tree_host.cc
@@ -142,6 +142,7 @@ LayerTreeHost::LayerTreeHost(InitParams* params, CompositorMode mode)
gpu_rasterization_histogram_recorded_(false),
background_color_(SK_ColorWHITE),
has_transparent_background_(false),
+ have_scroll_event_handlers_(false),
have_wheel_event_handlers_(false),
did_complete_scale_animation_(false),
in_paint_layer_contents_(false),
@@ -322,6 +323,7 @@ void LayerTreeHost::FinishCommitOnImplThread(LayerTreeHostImpl* host_impl) {
sync_tree->set_background_color(background_color_);
sync_tree->set_has_transparent_background(has_transparent_background_);
+ sync_tree->set_have_scroll_event_handlers(have_scroll_event_handlers_);
sync_tree->set_have_wheel_event_handlers(have_wheel_event_handlers_);
if (page_scale_layer_.get() && inner_viewport_scroll_layer_.get()) {
@@ -1036,6 +1038,14 @@ void LayerTreeHost::RegisterSelection(const LayerSelection& selection) {
SetNeedsCommit();
}
+void LayerTreeHost::SetHaveScrollEventHandlers(bool have_event_handlers) {
+ if (have_scroll_event_handlers_ == have_event_handlers)
+ return;
+
+ have_scroll_event_handlers_ = have_event_handlers;
+ SetNeedsCommit();
+}
+
void LayerTreeHost::SetHaveWheelEventHandlers(bool have_event_handlers) {
if (have_wheel_event_handlers_ == have_event_handlers)
return;
@@ -1358,6 +1368,7 @@ void LayerTreeHost::ToProtobufForCommit(proto::LayerTreeHost* proto) const {
content_is_suitable_for_gpu_rasterization_);
proto->set_background_color(background_color_);
proto->set_has_transparent_background(has_transparent_background_);
+ proto->set_have_scroll_event_handlers(have_scroll_event_handlers_);
proto->set_have_wheel_event_handlers(have_wheel_event_handlers_);
proto->set_in_paint_layer_contents(in_paint_layer_contents_);
proto->set_id(id_);
@@ -1423,6 +1434,7 @@ void LayerTreeHost::FromProtobufForCommit(const proto::LayerTreeHost& proto) {
proto.content_is_suitable_for_gpu_rasterization();
background_color_ = proto.background_color();
has_transparent_background_ = proto.has_transparent_background();
+ have_scroll_event_handlers_ = proto.have_scroll_event_handlers();
have_wheel_event_handlers_ = proto.have_wheel_event_handlers();
in_paint_layer_contents_ = proto.in_paint_layer_contents();
id_ = proto.id();

Powered by Google App Engine
This is Rietveld 408576698