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

Side by Side Diff: chrome/browser/ui/views/harmony/layout_delegate.cc

Issue 2753243002: Views/Harmony: Replace layout constants in chrome/browser/ui/views/extensions. (Closed)
Patch Set: Review comments. 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/ui/views/harmony/layout_delegate.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/views/harmony/layout_delegate.h" 5 #include "chrome/browser/ui/views/harmony/layout_delegate.h"
6 6
7 #include "base/lazy_instance.h" 7 #include "base/lazy_instance.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "chrome/browser/ui/views/chrome_views_delegate.h" 9 #include "chrome/browser/ui/views/chrome_views_delegate.h"
10 #include "chrome/browser/ui/views/harmony/chrome_typography.h" 10 #include "chrome/browser/ui/views/harmony/chrome_typography.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 return ChromeViewsDelegate::GetDefaultDistanceMetric( 42 return ChromeViewsDelegate::GetDefaultDistanceMetric(
43 views::DistanceMetric::CLOSE_BUTTON_MARGIN); 43 views::DistanceMetric::CLOSE_BUTTON_MARGIN);
44 case Metric::PANEL_CONTENT_MARGIN: 44 case Metric::PANEL_CONTENT_MARGIN:
45 return views::kPanelHorizMargin; 45 return views::kPanelHorizMargin;
46 case Metric::RELATED_BUTTON_HORIZONTAL_SPACING: 46 case Metric::RELATED_BUTTON_HORIZONTAL_SPACING:
47 return ChromeViewsDelegate::GetDefaultDistanceMetric( 47 return ChromeViewsDelegate::GetDefaultDistanceMetric(
48 views::DistanceMetric::RELATED_BUTTON_HORIZONTAL); 48 views::DistanceMetric::RELATED_BUTTON_HORIZONTAL);
49 case Metric::RELATED_CONTROL_HORIZONTAL_SPACING: 49 case Metric::RELATED_CONTROL_HORIZONTAL_SPACING:
50 return ChromeViewsDelegate::GetDefaultDistanceMetric( 50 return ChromeViewsDelegate::GetDefaultDistanceMetric(
51 views::DistanceMetric::RELATED_CONTROL_HORIZONTAL); 51 views::DistanceMetric::RELATED_CONTROL_HORIZONTAL);
52 case Metric::RELATED_CONTROL_HORIZONTAL_SPACING_SMALL:
53 return views::kRelatedControlSmallVerticalSpacing;
52 case Metric::RELATED_CONTROL_VERTICAL_SPACING: 54 case Metric::RELATED_CONTROL_VERTICAL_SPACING:
53 return ChromeViewsDelegate::GetDefaultDistanceMetric( 55 return ChromeViewsDelegate::GetDefaultDistanceMetric(
54 views::DistanceMetric::RELATED_CONTROL_VERTICAL); 56 views::DistanceMetric::RELATED_CONTROL_VERTICAL);
57 case Metric::RELATED_CONTROL_VERTICAL_SPACING_SMALL:
58 return views::kRelatedControlSmallVerticalSpacing;
55 case Metric::RELATED_LABEL_HORIZONTAL_SPACING: 59 case Metric::RELATED_LABEL_HORIZONTAL_SPACING:
56 return views::kItemLabelSpacing; 60 return views::kItemLabelSpacing;
57 case Metric::SUBSECTION_HORIZONTAL_INDENT: 61 case Metric::SUBSECTION_HORIZONTAL_INDENT:
58 return views::kCheckboxIndent; 62 return views::kCheckboxIndent;
59 case Metric::UNRELATED_CONTROL_HORIZONTAL_SPACING: 63 case Metric::UNRELATED_CONTROL_HORIZONTAL_SPACING:
60 return views::kUnrelatedControlHorizontalSpacing; 64 return views::kUnrelatedControlHorizontalSpacing;
61 case Metric::UNRELATED_CONTROL_HORIZONTAL_SPACING_LARGE: 65 case Metric::UNRELATED_CONTROL_HORIZONTAL_SPACING_LARGE:
62 return views::kUnrelatedControlLargeHorizontalSpacing; 66 return views::kUnrelatedControlLargeHorizontalSpacing;
63 case Metric::UNRELATED_CONTROL_VERTICAL_SPACING: 67 case Metric::UNRELATED_CONTROL_VERTICAL_SPACING:
64 return views::kUnrelatedControlVerticalSpacing; 68 return views::kUnrelatedControlVerticalSpacing;
(...skipping 24 matching lines...) Expand all
89 int LayoutDelegate::GetDialogPreferredWidth(DialogWidth width) const { 93 int LayoutDelegate::GetDialogPreferredWidth(DialogWidth width) const {
90 return 0; 94 return 0;
91 } 95 }
92 96
93 const views::TypographyProvider& LayoutDelegate::GetTypographyProvider() const { 97 const views::TypographyProvider& LayoutDelegate::GetTypographyProvider() const {
94 // This is not a data member because then HarmonyLayoutDelegate would inherit 98 // This is not a data member because then HarmonyLayoutDelegate would inherit
95 // it, even when it provides its own. 99 // it, even when it provides its own.
96 CR_DEFINE_STATIC_LOCAL(LegacyTypographyProvider, legacy_provider, ()); 100 CR_DEFINE_STATIC_LOCAL(LegacyTypographyProvider, legacy_provider, ());
97 return legacy_provider; 101 return legacy_provider;
98 } 102 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/harmony/layout_delegate.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698