Index: chrome/browser/ui/views/chrome_views_delegate.cc |
diff --git a/chrome/browser/ui/views/chrome_views_delegate.cc b/chrome/browser/ui/views/chrome_views_delegate.cc |
index c02c35b4f57e5343dea420b4a75df82c676dceda..3f3a540d76cbd74ce72ee0fc3517cd81a64089ef 100644 |
--- a/chrome/browser/ui/views/chrome_views_delegate.cc |
+++ b/chrome/browser/ui/views/chrome_views_delegate.cc |
@@ -538,43 +538,49 @@ ChromeViewsDelegate::GetBlockingPoolTaskRunner() { |
return content::BrowserThread::GetBlockingPool(); |
} |
-gfx::Insets ChromeViewsDelegate::GetDialogButtonInsets() const { |
+gfx::Insets ChromeViewsDelegate::GetInsetsMetric(InsetsMetric metric) const { |
const LayoutDelegate* layout_delegate = LayoutDelegate::Get(); |
- const int top = layout_delegate->GetMetric( |
- LayoutDelegate::Metric::DIALOG_BUTTON_TOP_SPACING); |
- const int margin = layout_delegate->GetMetric( |
- LayoutDelegate::Metric::DIALOG_BUTTON_MARGIN); |
- return gfx::Insets(top, margin, margin, margin); |
-} |
- |
-int ChromeViewsDelegate::GetDialogCloseButtonMargin() const { |
- return LayoutDelegate::Get()->GetMetric( |
- LayoutDelegate::Metric::DIALOG_CLOSE_BUTTON_MARGIN); |
-} |
- |
-int ChromeViewsDelegate::GetDialogRelatedButtonHorizontalSpacing() const { |
- return LayoutDelegate::Get()->GetMetric( |
- LayoutDelegate::Metric::RELATED_BUTTON_HORIZONTAL_SPACING); |
-} |
- |
-int ChromeViewsDelegate::GetDialogRelatedControlVerticalSpacing() const { |
- return LayoutDelegate::Get()->GetMetric( |
- LayoutDelegate::Metric::RELATED_CONTROL_VERTICAL_SPACING); |
-} |
- |
-gfx::Insets ChromeViewsDelegate::GetDialogFrameViewInsets() const { |
- const LayoutDelegate* layout_delegate = LayoutDelegate::Get(); |
- const int top = layout_delegate->GetMetric( |
- LayoutDelegate::Metric::PANEL_CONTENT_MARGIN); |
- const int side = layout_delegate->GetMetric( |
- LayoutDelegate::Metric::DIALOG_BUTTON_MARGIN); |
- // Titles are inset at the top and sides, but not at the bottom. |
- return gfx::Insets(top, side, 0, side); |
-} |
- |
-gfx::Insets ChromeViewsDelegate::GetBubbleDialogMargins() const { |
- return gfx::Insets(LayoutDelegate::Get()->GetMetric( |
- LayoutDelegate::Metric::PANEL_CONTENT_MARGIN)); |
+ switch (metric) { |
+ case InsetsMetric::DIALOG_BUTTON: { |
+ const int top = layout_delegate->GetMetric( |
+ LayoutDelegate::Metric::DIALOG_BUTTON_TOP_SPACING); |
+ const int margin = layout_delegate->GetMetric( |
+ LayoutDelegate::Metric::DIALOG_BUTTON_MARGIN); |
+ return gfx::Insets(top, margin, margin, margin); |
+ } |
+ case InsetsMetric::DIALOG_FRAME_VIEW: { |
+ const int top = layout_delegate->GetMetric( |
+ LayoutDelegate::Metric::PANEL_CONTENT_MARGIN); |
+ const int side = layout_delegate->GetMetric( |
+ LayoutDelegate::Metric::DIALOG_BUTTON_MARGIN); |
+ // Titles are inset at the top and sides, but not at the bottom. |
+ return gfx::Insets(top, side, 0, side); |
+ } |
+ case InsetsMetric::BUBBLE_DIALOG: |
+ return gfx::Insets(layout_delegate->GetMetric( |
+ LayoutDelegate::Metric::PANEL_CONTENT_MARGIN)); |
+ } |
+ NOTREACHED(); |
+ return gfx::Insets(); |
+} |
+ |
+int ChromeViewsDelegate::GetSpacingMetric(SpacingMetric metric) const { |
+ switch (metric) { |
+ case SpacingMetric::CLOSE_BUTTON_MARGIN: |
+ return LayoutDelegate::Get()->GetMetric( |
+ LayoutDelegate::Metric::DIALOG_CLOSE_BUTTON_MARGIN); |
+ case SpacingMetric::RELATED_HORIZONTAL_BUTTON: |
+ return LayoutDelegate::Get()->GetMetric( |
+ LayoutDelegate::Metric::RELATED_BUTTON_HORIZONTAL_SPACING); |
+ case SpacingMetric::RELATED_VERTICAL_CONTROL: |
+ return LayoutDelegate::Get()->GetMetric( |
+ LayoutDelegate::Metric::RELATED_CONTROL_VERTICAL_SPACING); |
+ case SpacingMetric::ICON_TO_TEXT: |
+ return LayoutDelegate::Get()->GetMetric( |
+ LayoutDelegate::Metric::ICON_TEXT_SPACING); |
+ } |
+ NOTREACHED(); |
+ return 0; |
} |
#if !defined(USE_ASH) |