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

Unified Diff: ui/views/layout/grid_layout.cc

Issue 2485083003: views: add layout delegates (Closed)
Patch Set: Created 4 years, 1 month 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
Index: ui/views/layout/grid_layout.cc
diff --git a/ui/views/layout/grid_layout.cc b/ui/views/layout/grid_layout.cc
index b45f1ca474dbdf7a17a9fd3acb1348b99213e9d2..41dcac0973c0ff760ce468722f312a69597c32e9 100644
--- a/ui/views/layout/grid_layout.cc
+++ b/ui/views/layout/grid_layout.cc
@@ -650,8 +650,12 @@ GridLayout::~GridLayout() {
// static
GridLayout* GridLayout::CreatePanel(View* host) {
GridLayout* layout = new GridLayout(host);
- layout->SetInsets(kPanelVertMargin, kButtonHEdgeMarginNew,
- kPanelVertMargin, kButtonHEdgeMarginNew);
+ LayoutDelegate* delegate = host->GetLayoutDelegate();
+ layout->SetInsets(
+ delegate->GetLayoutDistance(LayoutDelegate::PANEL_VERT_MARGIN),
+ delegate->GetLayoutDistance(LayoutDelegate::BUTTON_HEDGE_MARGIN_NEW),
+ delegate->GetLayoutDistance(LayoutDelegate::PANEL_VERT_MARGIN),
+ delegate->GetLayoutDistance(LayoutDelegate::BUTTON_HEDGE_MARGIN_NEW));
return layout;
}

Powered by Google App Engine
This is Rietveld 408576698