OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/layout_constants.h" | 5 #include "chrome/browser/ui/views/layout_constants.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "ui/base/resource/material_design/material_design_controller.h" | 8 #include "ui/base/resource/material_design/material_design_controller.h" |
9 | 9 |
10 int GetLayoutConstant(LayoutConstant constant) { | 10 int GetLayoutConstant(LayoutConstant constant) { |
11 const int kFindBarVerticalOffset[] = {1, 6, 6}; | 11 const int kFindBarVerticalOffset[] = {1, 6, 6}; |
12 const int kIconLabelViewInternalPadding[] = {3, 2, 2}; | 12 const int kIconLabelViewInternalPadding[] = {3, 2, 2}; |
13 const int kIconLabelViewTrailingPadding[] = {2, 8, 8}; | 13 const int kIconLabelViewTrailingPadding[] = {2, 8, 8}; |
14 const int kLocationBarBorderThickness[] = {2, 1, 1}; | 14 const int kLocationBarBorderThickness[] = {2, 1, 1}; |
15 const int kLocationBarBubbleHorizontalPadding[] = {1, 4, 4}; | 15 const int kLocationBarBubbleHorizontalPadding[] = {1, 4, 4}; |
16 const int kLocationBarBubbleVerticalPadding[] = {1, 4, 4}; | 16 const int kLocationBarBubbleVerticalPadding[] = {1, 4, 4}; |
17 const int kLocationBarHeight[] = {0, 28, 32}; | 17 const int kLocationBarHeight[] = {0, 28, 32}; |
18 const int kLocationBarHorizontalPadding[] = {3, 6, 6}; | 18 const int kLocationBarHorizontalPadding[] = {3, 6, 6}; |
19 const int kLocationBarVerticalPadding[] = {2, 2, 2}; | 19 const int kLocationBarVerticalPadding[] = {2, 2, 2}; |
20 const int kNewTabButtonWidth[] = {34, 34, 34}; | 20 const int kNewTabButtonWidth[] = {34, 34, 34}; |
21 const int kOmniboxDropdownBorderInterior[] = {6, 0, 0}; | 21 const int kOmniboxDropdownBorderInterior[] = {6, 0, 0}; |
22 const int kOmniboxFontPixelSize[] = {16, 14, 14}; | 22 const int kOmniboxFontPixelSize[] = {16, 14, 14}; |
23 const int kTabCloseButtonTrailingPaddingOverlap[] = {2, 2, 2}; | 23 const int kTabCloseButtonTrailingPaddingOverlap[] = {2, 2, 2}; |
24 const int kTabFaviconTitleSpacing[] = {4, 4, 4}; | 24 const int kTabFaviconTitleSpacing[] = {4, 4, 4}; |
25 const int kTabMaximumTitleWidth[] = {175, 175, 175}; | 25 const int kTabMaximumTitleWidth[] = {175, 175, 175}; |
26 const int kTabPinnedContentWidth[] = {25, 25, 25}; | 26 const int kTabPinnedContentWidth[] = {25, 25, 25}; |
27 #if defined(OS_MACOSX) | 27 #if defined(OS_MACOSX) |
| 28 const int kTabTopExclusionHeight[] = {0, 0, 0}; |
28 const int kTabstripNewTabButtonOverlap[] = {8, 8, 8}; | 29 const int kTabstripNewTabButtonOverlap[] = {8, 8, 8}; |
29 const int kTabstripTabOverlap[] = {19, 19, 19}; | 30 const int kTabstripTabOverlap[] = {19, 19, 19}; |
30 #else | 31 #else |
| 32 const int kTabTopExclusionHeight[] = {2, 2, 2}; |
31 const int kTabstripNewTabButtonOverlap[] = {11, 11, 11}; | 33 const int kTabstripNewTabButtonOverlap[] = {11, 11, 11}; |
32 const int kTabstripTabOverlap[] = {26, 26, 26}; | 34 const int kTabstripTabOverlap[] = {26, 26, 26}; |
33 #endif | 35 #endif |
34 const int kTabstripToolbarOverlap[] = {3, 3, 3}; | 36 const int kTabstripToolbarOverlap[] = {3, 3, 3}; |
35 const int kToolbarContentShadowHeight[] = {0, 0, 0}; | 37 const int kToolbarContentShadowHeight[] = {0, 0, 0}; |
36 const int kToolbarContentShadowHeightAsh[] = {2, 0, 0}; | 38 const int kToolbarContentShadowHeightAsh[] = {2, 0, 0}; |
37 const int kToolbarElementPadding[] = {0, 0, 8}; | 39 const int kToolbarElementPadding[] = {0, 0, 8}; |
38 const int kToolbarLocationBarRightPadding[] = {0, 4, 8}; | 40 const int kToolbarLocationBarRightPadding[] = {0, 4, 8}; |
39 const int kToolbarStandardSpacing[] = {3, 4, 8}; | 41 const int kToolbarStandardSpacing[] = {3, 4, 8}; |
40 | 42 |
(...skipping 30 matching lines...) Expand all Loading... |
71 case TABSTRIP_TOOLBAR_OVERLAP: | 73 case TABSTRIP_TOOLBAR_OVERLAP: |
72 return kTabstripToolbarOverlap[mode]; | 74 return kTabstripToolbarOverlap[mode]; |
73 case TAB_CLOSE_BUTTON_TRAILING_PADDING_OVERLAP: | 75 case TAB_CLOSE_BUTTON_TRAILING_PADDING_OVERLAP: |
74 return kTabCloseButtonTrailingPaddingOverlap[mode]; | 76 return kTabCloseButtonTrailingPaddingOverlap[mode]; |
75 case TAB_FAVICON_TITLE_SPACING: | 77 case TAB_FAVICON_TITLE_SPACING: |
76 return kTabFaviconTitleSpacing[mode]; | 78 return kTabFaviconTitleSpacing[mode]; |
77 case TAB_MAXIMUM_TITLE_WIDTH: | 79 case TAB_MAXIMUM_TITLE_WIDTH: |
78 return kTabMaximumTitleWidth[mode]; | 80 return kTabMaximumTitleWidth[mode]; |
79 case TAB_PINNED_CONTENT_WIDTH: | 81 case TAB_PINNED_CONTENT_WIDTH: |
80 return kTabPinnedContentWidth[mode]; | 82 return kTabPinnedContentWidth[mode]; |
| 83 case TAB_TOP_EXCLUSION_HEIGHT: |
| 84 return kTabTopExclusionHeight[mode]; |
81 case TOOLBAR_CONTENT_SHADOW_HEIGHT: | 85 case TOOLBAR_CONTENT_SHADOW_HEIGHT: |
82 return kToolbarContentShadowHeight[mode]; | 86 return kToolbarContentShadowHeight[mode]; |
83 case TOOLBAR_CONTENT_SHADOW_HEIGHT_ASH: | 87 case TOOLBAR_CONTENT_SHADOW_HEIGHT_ASH: |
84 return kToolbarContentShadowHeightAsh[mode]; | 88 return kToolbarContentShadowHeightAsh[mode]; |
85 case TOOLBAR_ELEMENT_PADDING: | 89 case TOOLBAR_ELEMENT_PADDING: |
86 return kToolbarElementPadding[mode]; | 90 return kToolbarElementPadding[mode]; |
87 case TOOLBAR_LOCATION_BAR_RIGHT_PADDING: | 91 case TOOLBAR_LOCATION_BAR_RIGHT_PADDING: |
88 return kToolbarLocationBarRightPadding[mode]; | 92 return kToolbarLocationBarRightPadding[mode]; |
89 case TOOLBAR_STANDARD_SPACING: | 93 case TOOLBAR_STANDARD_SPACING: |
90 return kToolbarStandardSpacing[mode]; | 94 return kToolbarStandardSpacing[mode]; |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 kToolbarBottomPadding[mode], | 140 kToolbarBottomPadding[mode], |
137 kToolbarRightPadding[mode]); | 141 kToolbarRightPadding[mode]); |
138 case TOOLBAR_BUTTON: { | 142 case TOOLBAR_BUTTON: { |
139 const int inset = kToolbarButtonPadding[mode]; | 143 const int inset = kToolbarButtonPadding[mode]; |
140 return gfx::Insets(inset, inset, inset, inset); | 144 return gfx::Insets(inset, inset, inset, inset); |
141 } | 145 } |
142 } | 146 } |
143 NOTREACHED(); | 147 NOTREACHED(); |
144 return gfx::Insets(); | 148 return gfx::Insets(); |
145 } | 149 } |
OLD | NEW |