Index: cc/layers/layer.cc |
diff --git a/cc/layers/layer.cc b/cc/layers/layer.cc |
index d96b381e02e54fe65aec55039539c7c0a3ac9a18..1efeb5b9b18446cee9d411e5acc3555549329191 100644 |
--- a/cc/layers/layer.cc |
+++ b/cc/layers/layer.cc |
@@ -65,7 +65,9 @@ Layer::Inputs::Inputs(int layer_id) |
clip_parent(nullptr), |
has_will_change_transform_hint(false), |
hide_layer_and_subtree(false), |
- client(nullptr) {} |
+ client(nullptr), |
+ scroll_boundary_behavior( |
+ ScrollBoundaryBehavior::kScrollBoundaryBehaviorTypeAuto) {} |
Layer::Inputs::~Inputs() {} |
@@ -306,6 +308,25 @@ void Layer::SetBounds(const gfx::Size& size) { |
SetNeedsCommit(); |
} |
+void Layer::SetScrollBoundaryBehavior(const ScrollBoundaryBehavior& behavior) { |
+ DCHECK(IsPropertyChangeAllowed()); |
+ if (scroll_boundary_behavior() == behavior) |
+ return; |
+ inputs_.scroll_boundary_behavior = behavior; |
+ if (!layer_tree_host_) |
+ return; |
+ |
+ if (scrollable()) { |
+ auto& scroll_tree = layer_tree_host_->property_trees()->scroll_tree; |
+ if (auto* scroll_node = scroll_tree.Node(scroll_tree_index_)) |
+ scroll_node->scroll_boundary_behavior = behavior; |
+ else |
+ SetPropertyTreesNeedRebuild(); |
+ } |
+ |
+ SetNeedsCommit(); |
+} |
+ |
Layer* Layer::RootLayer() { |
Layer* layer = this; |
while (layer->parent()) |