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

Unified Diff: ui/views/window/dialog_client_view.cc

Issue 2696263002: Refactor ViewsDelegate and MD-ify the icon-to-text spacing for checkbox and radiobutton (Closed)
Patch Set: Used ifdef instead of duplicated code for delegate initialization Created 3 years, 9 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/views_delegate.cc ('k') | ui/views/window/dialog_delegate.cc » ('j') | 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 fcf37d9f71fb28c991b67e3baf29771bcd52a150..5d543a7572efe2b85b8772f293c766cbdb19430f 100644
--- a/ui/views/window/dialog_client_view.cc
+++ b/ui/views/window/dialog_client_view.cc
@@ -75,8 +75,8 @@ class DialogClientView::ButtonRowContainer : public View {
DialogClientView::DialogClientView(Widget* owner, View* contents_view)
: ClientView(owner, contents_view),
- button_row_insets_(
- ViewsDelegate::GetInstance()->GetDialogButtonInsets()) {
+ button_row_insets_(ViewsDelegate::GetInstance()->GetInsetsMetric(
+ InsetsMetric::DIALOG_BUTTON)) {
// 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));
@@ -281,8 +281,8 @@ void DialogClientView::UpdateDialogButton(LabelButton** member,
button = MdTextButton::CreateSecondaryUiButton(this, title);
}
- const int minimum_width =
- ViewsDelegate::GetInstance()->GetDialogButtonMinimumWidth();
+ const int minimum_width = ViewsDelegate::GetInstance()->GetDistanceMetric(
+ views::DistanceMetric::DIALOG_BUTTON_MINIMUM_WIDTH);
button->SetMinSize(gfx::Size(minimum_width, 0));
button->SetGroup(kButtonGroup);
@@ -301,8 +301,8 @@ int DialogClientView::GetExtraViewSpacing() const {
if (GetDialogDelegate()->GetExtraViewPadding(&extra_view_padding))
return extra_view_padding;
- return ViewsDelegate::GetInstance()
- ->GetDialogRelatedButtonHorizontalSpacing();
+ return ViewsDelegate::GetInstance()->GetDistanceMetric(
+ views::DistanceMetric::RELATED_BUTTON_HORIZONTAL);
}
std::array<View*, DialogClientView::kNumButtons>
@@ -341,8 +341,8 @@ void DialogClientView::SetupLayout() {
// They expect GetDialogRelatedControlVerticalSpacing() in this case.
// TODO(tapted): Remove this under Harmony.
if (insets.top() == 0) {
- const int top =
- ViewsDelegate::GetInstance()->GetDialogRelatedControlVerticalSpacing();
+ const int top = ViewsDelegate::GetInstance()->GetDistanceMetric(
+ views::DistanceMetric::RELATED_CONTROL_VERTICAL);
insets.Set(top, insets.left(), insets.bottom(), insets.right());
}
@@ -356,8 +356,8 @@ void DialogClientView::SetupLayout() {
// GetExtraViewSpacing() handles <pad+stretchy>.
const int button_spacing =
(ok_button_ && cancel_button_)
- ? ViewsDelegate::GetInstance()
- ->GetDialogRelatedButtonHorizontalSpacing()
+ ? ViewsDelegate::GetInstance()->GetDistanceMetric(
+ views::DistanceMetric::RELATED_BUTTON_HORIZONTAL)
: 0;
constexpr int kButtonRowId = 0;
« no previous file with comments | « ui/views/views_delegate.cc ('k') | ui/views/window/dialog_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698