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/layout_constants.h" | 5 #include "chrome/browser/ui/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[] = {27, 28, 32}; | 17 const int kLocationBarHeight[] = {27, 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 kOmniboxDropdownBorderInterior[] = {6, 0, 0}; | 20 const int kOmniboxDropdownBorderInterior[] = {6, 0, 0}; |
21 const int kOmniboxFontPixelSize[] = {16, 14, 14}; | 21 const int kOmniboxFontPixelSize[] = {16, 14, 14}; |
22 const int kTabCloseButtonTrailingPaddingOverlap[] = {2, 0, 0}; | 22 const int kTabCloseButtonTrailingPaddingOverlap[] = {2, 0, 0}; |
23 const int kTabFaviconTitleSpacing[] = {4, 6, 6}; | 23 const int kTabFaviconTitleSpacing[] = {4, 6, 6}; |
24 const int kTabHeight[] = {29, 29, 29}; | 24 const int kTabHeight[] = {29, 29, 33}; |
25 const int kTabPinnedContentWidth[] = {25, 23, 23}; | 25 const int kTabPinnedContentWidth[] = {25, 23, 23}; |
26 #if defined(OS_MACOSX) | 26 #if defined(OS_MACOSX) |
27 const int kTabTopExclusionHeight[] = {0, 0, 0}; | 27 const int kTabTopExclusionHeight[] = {0, 0, 0}; |
28 const int kTabstripNewTabButtonOverlap[] = {8, 5, 5}; | 28 const int kTabstripNewTabButtonOverlap[] = {8, 5, 6}; |
29 const int kTabstripTabOverlap[] = {19, 16, 16}; | 29 const int kTabstripTabOverlap[] = {19, 16, 16}; |
30 #else | 30 #else |
31 const int kTabTopExclusionHeight[] = {2, 0, 0}; | 31 const int kTabTopExclusionHeight[] = {2, 0, 0}; |
32 const int kTabstripNewTabButtonOverlap[] = {11, 5, 5}; | 32 const int kTabstripNewTabButtonOverlap[] = {11, 5, 6}; |
33 const int kTabstripTabOverlap[] = {26, 16, 16}; | 33 const int kTabstripTabOverlap[] = {26, 16, 16}; |
34 #endif | 34 #endif |
35 const int kTabstripToolbarOverlap[] = {3, 0, 0}; | 35 const int kTabstripToolbarOverlap[] = {3, 0, 0}; |
36 const int kToolbarContentShadowHeight[] = {0, 0, 0}; | 36 const int kToolbarContentShadowHeight[] = {0, 0, 0}; |
37 const int kToolbarContentShadowHeightAsh[] = {2, 0, 0}; | 37 const int kToolbarContentShadowHeightAsh[] = {2, 0, 0}; |
38 const int kToolbarElementPadding[] = {0, 0, 8}; | 38 const int kToolbarElementPadding[] = {0, 0, 8}; |
39 const int kToolbarLocationBarRightPadding[] = {0, 4, 8}; | 39 const int kToolbarLocationBarRightPadding[] = {0, 4, 8}; |
40 const int kToolbarStandardSpacing[] = {3, 4, 8}; | 40 const int kToolbarStandardSpacing[] = {3, 4, 8}; |
41 | 41 |
42 const int mode = ui::MaterialDesignController::GetMode(); | 42 const int mode = ui::MaterialDesignController::GetMode(); |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 } | 95 } |
96 | 96 |
97 gfx::Insets GetLayoutInsets(LayoutInset inset) { | 97 gfx::Insets GetLayoutInsets(LayoutInset inset) { |
98 const int kAvatarLeftPadding[] = {2, 4, 4}; | 98 const int kAvatarLeftPadding[] = {2, 4, 4}; |
99 const int kAvatarRightPadding[] = {-6, 4, 4}; | 99 const int kAvatarRightPadding[] = {-6, 4, 4}; |
100 const int kAvatarBottomPadding[] = {2, 4, 4}; | 100 const int kAvatarBottomPadding[] = {2, 4, 4}; |
101 const int kOmniboxDropdownIconPadding[] = {2, 4, 8}; | 101 const int kOmniboxDropdownIconPadding[] = {2, 4, 8}; |
102 const int kOmniboxDropdownPadding[] = {3, 4, 4}; | 102 const int kOmniboxDropdownPadding[] = {3, 4, 4}; |
103 const int kOmniboxDropdownTextPadding[] = {3, 3, 3}; | 103 const int kOmniboxDropdownTextPadding[] = {3, 3, 3}; |
104 const int kTabBottomPadding[] = {2, 1, 1}; | 104 const int kTabBottomPadding[] = {2, 1, 1}; |
105 const int kTabLeftPadding[] = {20, 16, 16}; | 105 const int kTabLeftPadding[] = {20, 16, 18}; |
106 const int kTabRightPadding[] = {20, 16, 16}; | 106 const int kTabRightPadding[] = {20, 16, 18}; |
107 const int kTabTopPadding[] = {4, 1, 1}; | 107 const int kTabTopPadding[] = {4, 1, 1}; |
108 const int kToolbarBottomPadding[] = {5, 5, 5}; | 108 const int kToolbarBottomPadding[] = {5, 5, 5}; |
109 const int kToolbarButtonPadding[] = {2, 6, 6}; | 109 const int kToolbarButtonPadding[] = {2, 6, 6}; |
110 const int kToolbarLeftPadding[] = {3, 4, 8}; | 110 const int kToolbarLeftPadding[] = {3, 4, 8}; |
111 const int kToolbarRightPadding[] = {2, 4, 8}; | 111 const int kToolbarRightPadding[] = {2, 4, 8}; |
112 const int kToolbarTopPadding[] = {5, 4, 4}; | 112 const int kToolbarTopPadding[] = {5, 4, 4}; |
113 | 113 |
114 const int mode = ui::MaterialDesignController::GetMode(); | 114 const int mode = ui::MaterialDesignController::GetMode(); |
115 switch (inset) { | 115 switch (inset) { |
116 case AVATAR_ICON: | 116 case AVATAR_ICON: |
(...skipping 21 matching lines...) Expand all Loading... |
138 case TOOLBAR_BUTTON: { | 138 case TOOLBAR_BUTTON: { |
139 const int inset = kToolbarButtonPadding[mode]; | 139 const int inset = kToolbarButtonPadding[mode]; |
140 return gfx::Insets(inset, inset, inset, inset); | 140 return gfx::Insets(inset, inset, inset, inset); |
141 } | 141 } |
142 } | 142 } |
143 NOTREACHED(); | 143 NOTREACHED(); |
144 return gfx::Insets(); | 144 return gfx::Insets(); |
145 } | 145 } |
146 | 146 |
147 gfx::Size GetLayoutSize(LayoutSize size) { | 147 gfx::Size GetLayoutSize(LayoutSize size) { |
148 const int kNewTabButtonWidth[] = {34, 36, 36}; | 148 const int kNewTabButtonWidth[] = {34, 36, 39}; |
149 const int kNewTabButtonHeight[] = {18, 18, 18}; | 149 const int kNewTabButtonHeight[] = {18, 18, 21}; |
150 | 150 |
151 const int mode = ui::MaterialDesignController::GetMode(); | 151 const int mode = ui::MaterialDesignController::GetMode(); |
152 switch (size) { | 152 switch (size) { |
153 case NEW_TAB_BUTTON: | 153 case NEW_TAB_BUTTON: |
154 return gfx::Size(kNewTabButtonWidth[mode], kNewTabButtonHeight[mode]); | 154 return gfx::Size(kNewTabButtonWidth[mode], kNewTabButtonHeight[mode]); |
155 } | 155 } |
156 NOTREACHED(); | 156 NOTREACHED(); |
157 return gfx::Size(); | 157 return gfx::Size(); |
158 } | 158 } |
OLD | NEW |