Chromium Code Reviews| Index: cc/layers/layer.cc |
| diff --git a/cc/layers/layer.cc b/cc/layers/layer.cc |
| index 1abdaebf90676feafe9cbd9c35e7bb2ff0ff947d..b54b136ab8f555457a028b54ad25a1b26f97b5d1 100644 |
| --- a/cc/layers/layer.cc |
| +++ b/cc/layers/layer.cc |
| @@ -97,6 +97,7 @@ Layer::Layer() |
| force_render_surface_for_testing_(false), |
| subtree_property_changed_(false), |
| may_contain_video_(false), |
| + scrollbars_hidden_(false), |
|
aelias_OOO_until_Jul13
2016/10/26 19:01:03
This state is redundant with the one in Scrollable
bokan
2016/10/27 20:56:46
Done.
|
| safe_opaque_background_color_(0), |
| draw_blend_mode_(SkXfermode::kSrcOver_Mode), |
| num_unclipped_descendants_(0) {} |
| @@ -825,6 +826,7 @@ void Layer::SetScrollOffsetFromImplSide( |
| if (!inputs_.did_scroll_callback.is_null()) |
| inputs_.did_scroll_callback.Run(); |
| + |
|
aelias_OOO_until_Jul13
2016/10/26 19:01:03
nit: unnecessary newline
bokan
2016/10/27 20:56:46
Done.
|
| // The callback could potentially change the layer structure: |
| // "this" may have been destroyed during the process. |
| } |
| @@ -1391,6 +1393,7 @@ void Layer::LayerSpecificPropertiesToProto(proto::LayerProperties* proto, |
| base->mutable_offset_to_transform_parent()); |
| base->set_draws_content(draws_content_); |
| base->set_may_contain_video(may_contain_video_); |
| + // TODO(bokan): Should we serialize the scrollbars_enabled flag? |
| base->set_hide_layer_and_subtree(inputs_.hide_layer_and_subtree); |
| base->set_subtree_property_changed(subtree_property_changed_); |
| @@ -1454,6 +1457,7 @@ void Layer::FromLayerSpecificPropertiesProto( |
| inputs_.double_sided = base.double_sided(); |
| draws_content_ = base.draws_content(); |
| may_contain_video_ = base.may_contain_video(); |
| + // TODO(bokan): scrollbars_hidden_ |
| inputs_.hide_layer_and_subtree = base.hide_layer_and_subtree(); |
| subtree_property_changed_ = base.subtree_property_changed(); |
| inputs_.masks_to_bounds = base.masks_to_bounds(); |
| @@ -1607,6 +1611,15 @@ void Layer::SetMayContainVideo(bool yes) { |
| SetNeedsPushProperties(); |
| } |
| +void Layer::SetScrollbarsHiddenFromImplSide(bool hidden) { |
| + if (scrollbars_hidden_ == hidden) |
| + return; |
| + |
| + scrollbars_hidden_ = hidden; |
| + if (inputs_.client) |
| + inputs_.client->didChangeScrollbarsHidden(hidden); |
| +} |
| + |
| bool Layer::FilterIsAnimating() const { |
| return GetAnimationHost()->IsAnimatingFilterProperty( |
| element_id(), GetElementTypeForAnimation()); |