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

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 Bookmark and Global error unittests 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 9f5dad1e175abe692836ea344311bd536bbf88fe..88cdf65a01d043b1ed7c2a7aadea936c48412d02 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,23 +36,23 @@ 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_VERTICAL_SPACING:
- return ChromeViewsDelegate::GetDefaultDistanceMetric(
+ return ChromeViewsLayoutDelegate::Get()->GetDefaultDistanceMetric(
views::DistanceMetric::RELATED_CONTROL_VERTICAL);
case Metric::RELATED_LABEL_HORIZONTAL_SPACING:
return views::kItemLabelSpacing;

Powered by Google App Engine
This is Rietveld 408576698