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

Unified Diff: ui/views/window/dialog_client_view.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
« ui/views/layout/layout_delegate.h ('K') | « ui/views/view.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/window/dialog_client_view.cc
diff --git a/ui/views/window/dialog_client_view.cc b/ui/views/window/dialog_client_view.cc
index ce9099fb3931760943a25b2c403845c99979f70e..92c969eea1c38f521ac68501c4340b7b1cdb1fd9 100644
--- a/ui/views/window/dialog_client_view.cc
+++ b/ui/views/window/dialog_client_view.cc
@@ -52,7 +52,9 @@ void LayoutButton(LabelButton* button,
row_bounds->right(),
row_bounds->y() + (row_bounds->height() - button_height) / 2,
size.width(), button_height);
- row_bounds->set_width(row_bounds->width() - kRelatedButtonHSpacing);
+ row_bounds->set_width(row_bounds->width() -
+ button->GetLayoutDelegate()->GetLayoutDistance(
+ LayoutDelegate::RELATED_BUTTON_HORIZONTAL_SPACING));
}
} // namespace
@@ -63,13 +65,17 @@ void LayoutButton(LabelButton* button,
DialogClientView::DialogClientView(Widget* owner, View* contents_view)
: ClientView(owner, contents_view),
button_row_insets_(0,
- kButtonHEdgeMarginNew,
- kButtonVEdgeMarginNew,
- kButtonHEdgeMarginNew),
+ contents_view->GetLayoutDelegate()->GetLayoutDistance(
+ LayoutDelegate::BUTTON_HEDGE_MARGIN_NEW),
+ contents_view->GetLayoutDelegate()->GetLayoutDistance(
+ LayoutDelegate::BUTTON_VEDGE_MARGIN_NEW),
+ contents_view->GetLayoutDelegate()->GetLayoutDistance(
+ LayoutDelegate::BUTTON_HEDGE_MARGIN_NEW)),
ok_button_(nullptr),
cancel_button_(nullptr),
extra_view_(nullptr),
delegate_allowed_close_(false) {
+ SetLayoutDelegate(contents_view->GetLayoutDelegate());
// Doing this now ensures this accelerator will have lower priority than
// one set by the contents view.
AddAccelerator(ui::Accelerator(ui::VKEY_ESCAPE, ui::EF_NONE));
« ui/views/layout/layout_delegate.h ('K') | « ui/views/view.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698