| Index: ui/views/views_delegate.cc
|
| diff --git a/ui/views/views_delegate.cc b/ui/views/views_delegate.cc
|
| index 8a78a96dedebbfa88229cb5d34284fd31393e216..a9e138ce064185e5796528644fbeb13d5b0f8b89 100644
|
| --- a/ui/views/views_delegate.cc
|
| +++ b/ui/views/views_delegate.cc
|
| @@ -19,6 +19,9 @@ namespace {
|
|
|
| ViewsDelegate* views_delegate = nullptr;
|
|
|
| +// Horizontal spacing between the image of a label button and its text. This
|
| +// affects checkboxes and radiobuttons.
|
| +constexpr int kIconTextSpacing = 5;
|
| }
|
|
|
| ViewsDelegate::~ViewsDelegate() {
|
| @@ -126,42 +129,38 @@ scoped_refptr<base::TaskRunner> ViewsDelegate::GetBlockingPoolTaskRunner() {
|
| return nullptr;
|
| }
|
|
|
| -gfx::Insets ViewsDelegate::GetDialogButtonInsets() const {
|
| - return gfx::Insets(0, kButtonHEdgeMarginNew, kButtonVEdgeMarginNew,
|
| - kButtonHEdgeMarginNew);
|
| -}
|
| -
|
| -int ViewsDelegate::GetDialogCloseButtonMargin() const {
|
| - return kCloseButtonMargin;
|
| -}
|
| -
|
| -int ViewsDelegate::GetDialogRelatedButtonHorizontalSpacing() const {
|
| - return kRelatedButtonHSpacing;
|
| -}
|
| -
|
| -int ViewsDelegate::GetDialogRelatedControlVerticalSpacing() const {
|
| - return kRelatedControlVerticalSpacing;
|
| -}
|
| -
|
| -gfx::Insets ViewsDelegate::GetDialogFrameViewInsets() const {
|
| - return gfx::Insets(kPanelVertMargin, kButtonHEdgeMarginNew, 0,
|
| - kButtonHEdgeMarginNew);
|
| -}
|
| -
|
| -gfx::Insets ViewsDelegate::GetBubbleDialogMargins() const {
|
| - return gfx::Insets(kPanelVertMargin, kPanelHorizMargin);
|
| -}
|
| -
|
| -int ViewsDelegate::GetButtonMinimumWidth() const {
|
| - return kMinimumButtonWidth;
|
| -}
|
| -
|
| -int ViewsDelegate::GetDialogButtonMinimumWidth() const {
|
| - return kDialogMinimumButtonWidth;
|
| -}
|
| -
|
| -int ViewsDelegate::GetButtonHorizontalPadding() const {
|
| - return kButtonHorizontalPadding;
|
| +gfx::Insets ViewsDelegate::GetInsetsMetric(InsetsMetric metric) const {
|
| + switch (metric) {
|
| + case InsetsMetric::DIALOG_BUTTON:
|
| + return gfx::Insets(0, kButtonHEdgeMarginNew, kButtonVEdgeMarginNew,
|
| + kButtonHEdgeMarginNew);
|
| + case InsetsMetric::DIALOG_FRAME_VIEW:
|
| + return gfx::Insets(kPanelVertMargin, kButtonHEdgeMarginNew, 0,
|
| + kButtonHEdgeMarginNew);
|
| + case InsetsMetric::BUBBLE_DIALOG:
|
| + return gfx::Insets(kPanelVertMargin, kPanelHorizMargin);
|
| + }
|
| + NOTREACHED();
|
| + return gfx::Insets();
|
| +}
|
| +
|
| +int ViewsDelegate::GetSpacingMetric(SpacingMetric metric) const {
|
| + switch (metric) {
|
| + case SpacingMetric::CLOSE_BUTTON_MARGIN:
|
| + return kCloseButtonMargin;
|
| + case SpacingMetric::ICON_TO_TEXT:
|
| + return kIconTextSpacing;
|
| + case SpacingMetric::RELATED_HORIZONTAL_BUTTON:
|
| + return kRelatedButtonHSpacing;
|
| + case SpacingMetric::RELATED_VERTICAL_CONTROL:
|
| + return kRelatedControlVerticalSpacing;
|
| + case SpacingMetric::DIALOG_BUTTON_MINIMUM_WIDTH:
|
| + return kDialogMinimumButtonWidth;
|
| + case SpacingMetric::BUTTON_HORIZONTAL_PADDING:
|
| + return kButtonHorizontalPadding;
|
| + }
|
| + NOTREACHED();
|
| + return 0;
|
| }
|
|
|
| ViewsDelegate::ViewsDelegate()
|
|
|