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

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

Issue 2696263002: Refactor ViewsDelegate and MD-ify the icon-to-text spacing for checkbox and radiobutton (Closed)
Patch Set: Reduced ViewsDelegate layout/metric functions to only two functions Created 3 years, 10 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
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/harmony_layout_delegate.h" 5 #include "chrome/browser/ui/views/harmony/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 9
10 static base::LazyInstance<HarmonyLayoutDelegate> harmony_layout_delegate_ = 10 static base::LazyInstance<HarmonyLayoutDelegate> harmony_layout_delegate_ =
(...skipping 23 matching lines...) Expand all
34 case Metric::RELATED_CONTROL_VERTICAL_SPACING: 34 case Metric::RELATED_CONTROL_VERTICAL_SPACING:
35 return kHarmonyLayoutUnit / 2; 35 return kHarmonyLayoutUnit / 2;
36 case Metric::RELATED_LABEL_HORIZONTAL_SPACING: 36 case Metric::RELATED_LABEL_HORIZONTAL_SPACING:
37 return kHarmonyLayoutUnit; 37 return kHarmonyLayoutUnit;
38 case Metric::SUBSECTION_HORIZONTAL_INDENT: 38 case Metric::SUBSECTION_HORIZONTAL_INDENT:
39 return 0; 39 return 0;
40 case Metric::UNRELATED_CONTROL_VERTICAL_SPACING: 40 case Metric::UNRELATED_CONTROL_VERTICAL_SPACING:
41 return kHarmonyLayoutUnit; 41 return kHarmonyLayoutUnit;
42 case Metric::UNRELATED_CONTROL_VERTICAL_SPACING_LARGE: 42 case Metric::UNRELATED_CONTROL_VERTICAL_SPACING_LARGE:
43 return kHarmonyLayoutUnit; 43 return kHarmonyLayoutUnit;
44 case Metric::ICON_TEXT_SPACING:
45 return kHarmonyLayoutUnit;
44 } 46 }
45 NOTREACHED(); 47 NOTREACHED();
46 return 0; 48 return 0;
47 } 49 }
48 50
49 views::GridLayout::Alignment 51 views::GridLayout::Alignment
50 HarmonyLayoutDelegate::GetControlLabelGridAlignment() const { 52 HarmonyLayoutDelegate::GetControlLabelGridAlignment() const {
51 return views::GridLayout::LEADING; 53 return views::GridLayout::LEADING;
52 } 54 }
53 55
(...skipping 10 matching lines...) Expand all
64 case DialogWidth::SMALL: 66 case DialogWidth::SMALL:
65 return 320; 67 return 320;
66 case DialogWidth::MEDIUM: 68 case DialogWidth::MEDIUM:
67 return 448; 69 return 448;
68 case DialogWidth::LARGE: 70 case DialogWidth::LARGE:
69 return 512; 71 return 512;
70 } 72 }
71 NOTREACHED(); 73 NOTREACHED();
72 return 0; 74 return 0;
73 } 75 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698