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

Unified Diff: ui/views/controls/scroll_view.cc

Issue 2229943003: Reusing Ok/Cancel buttons for intent picker (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removing callback usage on WebContentsDestroyed Created 4 years, 2 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
« no previous file with comments | « ui/views/controls/scroll_view.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
« no previous file with comments | « ui/views/controls/scroll_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698