Chromium Code Reviews| Index: ui/views/controls/scroll_view.cc |
| diff --git a/ui/views/controls/scroll_view.cc b/ui/views/controls/scroll_view.cc |
| index 68ee68fee3eaa8561e097be266a8ec202f448155..2f0c4a52f96ef7a3acbc2fa643a97fdc9b0b3afc 100644 |
| --- a/ui/views/controls/scroll_view.cc |
| +++ b/ui/views/controls/scroll_view.cc |
| @@ -683,6 +683,28 @@ bool ScrollView::ScrollsWithLayers() const { |
| return contents_viewport_->layer() != nullptr; |
| } |
| +void ScrollView::ActivateLayer(bool force_layer_creation) { |
|
sky
2016/10/14 22:59:27
This name is mildly confusing and why does it take
djacobo_
2016/10/14 23:35:32
I am still trying to figure out how to do the prop
|
| + if (force_layer_creation || ChildrenLayerCheck(contents_viewport_)) { |
| + background_color_ = SK_ColorWHITE; |
| + contents_viewport_->set_background( |
| + Background::CreateSolidBackground(background_color_)); |
| + contents_viewport_->SetPaintToLayer(true); |
| + contents_viewport_->layer()->SetMasksToBounds(true); |
| + } |
| +} |
| + |
| +bool ScrollView::ChildrenLayerCheck(View* child) const { |
| + if (!child) |
| + return false; |
| + if (child->layer() != nullptr) |
| + return true; |
| + |
| + for (int i = 0; i < child->child_count(); ++i) |
| + if (ChildrenLayerCheck(child->child_at(i))) |
| + return true; |
| + return false; |
| +} |
| + |
| void ScrollView::OnLayerScrolled() { |
| UpdateScrollBarPositions(); |
| ScrollHeader(); |