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

Unified Diff: chrome/browser/ui/views/harmony/layout_delegate.cc

Issue 2758323002: Broke out layout metric information from ViewsDelegate to LayoutProvider (Closed)
Patch Set: Fix various unit-tests 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
Index: chrome/browser/ui/views/harmony/layout_delegate.cc
diff --git a/chrome/browser/ui/views/harmony/layout_delegate.cc b/chrome/browser/ui/views/harmony/layout_delegate.cc
index 9967dcbb45a0a82b8aa501b4ba4a1b2145f62f87..4b140c21d7fed399b7da7ab047c9e03c6ead945e 100644
--- a/chrome/browser/ui/views/harmony/layout_delegate.cc
+++ b/chrome/browser/ui/views/harmony/layout_delegate.cc
@@ -8,9 +8,11 @@
#include "base/logging.h"
#include "chrome/browser/ui/views/chrome_views_delegate.h"
#include "chrome/browser/ui/views/harmony/chrome_typography.h"
+#include "chrome/browser/ui/views/harmony/chrome_views_layout_delegate.h"
#include "chrome/browser/ui/views/harmony/harmony_layout_delegate.h"
#include "ui/base/material_design/material_design_controller.h"
#include "ui/views/layout/layout_constants.h"
+#include "ui/views/layout/views_layout_delegate.h"
static base::LazyInstance<LayoutDelegate>::DestructorAtExit layout_delegate_ =
LAZY_INSTANCE_INITIALIZER;
@@ -25,7 +27,7 @@ LayoutDelegate* LayoutDelegate::Get() {
int LayoutDelegate::GetMetric(Metric metric) const {
switch (metric) {
case Metric::BUTTON_HORIZONTAL_PADDING:
- return ChromeViewsDelegate::GetDefaultDistanceMetric(
+ return ChromeViewsLayoutDelegate::Get()->GetDefaultDistanceMetric(
views::DistanceMetric::BUTTON_HORIZONTAL_PADDING);
case Metric::BUTTON_MAX_LINKABLE_WIDTH:
return 0; // Buttons never expand during layout (add padding instead).
@@ -34,25 +36,25 @@ int LayoutDelegate::GetMetric(Metric metric) const {
case Metric::DIALOG_BUTTON_MARGIN:
return views::kButtonHEdgeMarginNew;
case Metric::DIALOG_BUTTON_MINIMUM_WIDTH:
- return ChromeViewsDelegate::GetDefaultDistanceMetric(
+ return ChromeViewsLayoutDelegate::Get()->GetDefaultDistanceMetric(
views::DistanceMetric::DIALOG_BUTTON_MINIMUM_WIDTH);
case Metric::DIALOG_BUTTON_TOP_SPACING:
return 0;
case Metric::DIALOG_CLOSE_BUTTON_MARGIN:
- return ChromeViewsDelegate::GetDefaultDistanceMetric(
+ return ChromeViewsLayoutDelegate::Get()->GetDefaultDistanceMetric(
views::DistanceMetric::CLOSE_BUTTON_MARGIN);
case Metric::PANEL_CONTENT_MARGIN:
return views::kPanelHorizMargin;
case Metric::RELATED_BUTTON_HORIZONTAL_SPACING:
- return ChromeViewsDelegate::GetDefaultDistanceMetric(
+ return ChromeViewsLayoutDelegate::Get()->GetDefaultDistanceMetric(
views::DistanceMetric::RELATED_BUTTON_HORIZONTAL);
case Metric::RELATED_CONTROL_HORIZONTAL_SPACING:
- return ChromeViewsDelegate::GetDefaultDistanceMetric(
+ return ChromeViewsLayoutDelegate::Get()->GetDefaultDistanceMetric(
views::DistanceMetric::RELATED_CONTROL_HORIZONTAL);
case Metric::RELATED_CONTROL_HORIZONTAL_SPACING_SMALL:
return views::kRelatedControlSmallVerticalSpacing;
case Metric::RELATED_CONTROL_VERTICAL_SPACING:
- return ChromeViewsDelegate::GetDefaultDistanceMetric(
+ return ChromeViewsLayoutDelegate::Get()->GetDefaultDistanceMetric(
views::DistanceMetric::RELATED_CONTROL_VERTICAL);
case Metric::RELATED_CONTROL_VERTICAL_SPACING_SMALL:
return views::kRelatedControlSmallVerticalSpacing;

Powered by Google App Engine
This is Rietveld 408576698