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

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

Issue 2436543003: reland: Reusing Ok/Cancel buttons for intent picker (Closed)
Patch Set: Modifying the way I create a dummy event for the testing. 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 a358128a5a8d73940bde2ebf762cc8c0d123dab6..58fa126eef183ec28cd56d4df166419611c4366f 100644
--- a/ui/views/controls/scroll_view.cc
+++ b/ui/views/controls/scroll_view.cc
@@ -183,12 +183,7 @@ ScrollView::ScrollView()
if (!base::FeatureList::IsEnabled(kToolkitViewsScrollWithLayers))
return;
-
- background_color_ = SK_ColorWHITE;
- contents_viewport_->set_background(
- Background::CreateSolidBackground(background_color_));
- contents_viewport_->SetPaintToLayer(true);
- contents_viewport_->layer()->SetMasksToBounds(true);
+ EnableViewPortLayer();
}
ScrollView::~ScrollView() {
@@ -699,6 +694,14 @@ bool ScrollView::ScrollsWithLayers() const {
return contents_viewport_->layer() != nullptr;
}
+void ScrollView::EnableViewPortLayer() {
+ background_color_ = SK_ColorWHITE;
+ contents_viewport_->set_background(
+ Background::CreateSolidBackground(background_color_));
+ contents_viewport_->SetPaintToLayer(true);
+ contents_viewport_->layer()->SetMasksToBounds(true);
+}
+
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