| 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 kNewTabButtonWidth[] = {34, 34, 34}; | 20 const int kNewTabButtonWidth[] = {34, 36, 36}; |
| 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, 0, 0}; |
| 24 const int kTabFaviconTitleSpacing[] = {4, 4, 4}; | 24 const int kTabFaviconTitleSpacing[] = {4, 6, 6}; |
| 25 const int kTabMaximumTitleWidth[] = {175, 175, 175}; | 25 const int kTabMaximumTitleWidth[] = {175, 171, 171}; |
| 26 const int kTabPinnedContentWidth[] = {25, 25, 25}; | 26 const int kTabPinnedContentWidth[] = {25, 23, 23}; |
| 27 #if defined(OS_MACOSX) | 27 #if defined(OS_MACOSX) |
| 28 const int kTabTopExclusionHeight[] = {0, 0, 0}; | 28 const int kTabTopExclusionHeight[] = {0, 0, 0}; |
| 29 const int kTabstripNewTabButtonOverlap[] = {8, 8, 8}; | 29 const int kTabstripNewTabButtonOverlap[] = {8, 5, 5}; |
| 30 const int kTabstripTabOverlap[] = {19, 19, 19}; | 30 const int kTabstripTabOverlap[] = {19, 16, 16}; |
| 31 #else | 31 #else |
| 32 const int kTabTopExclusionHeight[] = {2, 2, 2}; | 32 const int kTabTopExclusionHeight[] = {2, 0, 0}; |
| 33 const int kTabstripNewTabButtonOverlap[] = {11, 11, 11}; | 33 const int kTabstripNewTabButtonOverlap[] = {11, 5, 5}; |
| 34 const int kTabstripTabOverlap[] = {26, 26, 26}; | 34 const int kTabstripTabOverlap[] = {26, 16, 16}; |
| 35 #endif | 35 #endif |
| 36 const int kTabstripToolbarOverlap[] = {3, 3, 3}; | 36 const int kTabstripToolbarOverlap[] = {3, 0, 0}; |
| 37 const int kToolbarContentShadowHeight[] = {0, 0, 0}; | 37 const int kToolbarContentShadowHeight[] = {0, 0, 0}; |
| 38 const int kToolbarContentShadowHeightAsh[] = {2, 0, 0}; | 38 const int kToolbarContentShadowHeightAsh[] = {2, 0, 0}; |
| 39 const int kToolbarElementPadding[] = {0, 0, 8}; | 39 const int kToolbarElementPadding[] = {0, 0, 8}; |
| 40 const int kToolbarLocationBarRightPadding[] = {0, 4, 8}; | 40 const int kToolbarLocationBarRightPadding[] = {0, 4, 8}; |
| 41 const int kToolbarStandardSpacing[] = {3, 4, 8}; | 41 const int kToolbarStandardSpacing[] = {3, 4, 8}; |
| 42 | 42 |
| 43 const int mode = ui::MaterialDesignController::GetMode(); | 43 const int mode = ui::MaterialDesignController::GetMode(); |
| 44 switch (constant) { | 44 switch (constant) { |
| 45 case FIND_BAR_TOOLBAR_OVERLAP: | 45 case FIND_BAR_TOOLBAR_OVERLAP: |
| 46 return kFindBarVerticalOffset[mode]; | 46 return kFindBarVerticalOffset[mode]; |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 return 0; | 97 return 0; |
| 98 } | 98 } |
| 99 | 99 |
| 100 gfx::Insets GetLayoutInsets(LayoutInset inset) { | 100 gfx::Insets GetLayoutInsets(LayoutInset inset) { |
| 101 const int kAvatarLeftPadding[] = {2, 4, 4}; | 101 const int kAvatarLeftPadding[] = {2, 4, 4}; |
| 102 const int kAvatarRightPadding[] = {-6, 4, 4}; | 102 const int kAvatarRightPadding[] = {-6, 4, 4}; |
| 103 const int kAvatarBottomPadding[] = {2, 4, 4}; | 103 const int kAvatarBottomPadding[] = {2, 4, 4}; |
| 104 const int kOmniboxDropdownIconPadding[] = {2, 4, 8}; | 104 const int kOmniboxDropdownIconPadding[] = {2, 4, 8}; |
| 105 const int kOmniboxDropdownPadding[] = {3, 4, 4}; | 105 const int kOmniboxDropdownPadding[] = {3, 4, 4}; |
| 106 const int kOmniboxDropdownTextPadding[] = {3, 3, 3}; | 106 const int kOmniboxDropdownTextPadding[] = {3, 3, 3}; |
| 107 const int kTabBottomPadding[] = {2, 2, 2}; | 107 const int kTabBottomPadding[] = {2, 1, 1}; |
| 108 const int kTabLeftPadding[] = {20, 20, 20}; | 108 const int kTabLeftPadding[] = {20, 16, 16}; |
| 109 const int kTabRightPadding[] = {20, 20, 20}; | 109 const int kTabRightPadding[] = {20, 16, 16}; |
| 110 const int kTabTopPadding[] = {4, 4, 4}; | 110 const int kTabTopPadding[] = {4, 1, 1}; |
| 111 const int kToolbarBottomPadding[] = {5, 5, 5}; | 111 const int kToolbarBottomPadding[] = {5, 5, 5}; |
| 112 const int kToolbarButtonPadding[] = {2, 6, 6}; | 112 const int kToolbarButtonPadding[] = {2, 6, 6}; |
| 113 const int kToolbarLeftPadding[] = {3, 4, 8}; | 113 const int kToolbarLeftPadding[] = {3, 4, 8}; |
| 114 const int kToolbarRightPadding[] = {2, 4, 8}; | 114 const int kToolbarRightPadding[] = {2, 4, 8}; |
| 115 const int kToolbarTopPadding[] = {5, 4, 4}; | 115 const int kToolbarTopPadding[] = {5, 4, 4}; |
| 116 | 116 |
| 117 const int mode = ui::MaterialDesignController::GetMode(); | 117 const int mode = ui::MaterialDesignController::GetMode(); |
| 118 switch (inset) { | 118 switch (inset) { |
| 119 case AVATAR_ICON: { | 119 case AVATAR_ICON: { |
| 120 return gfx::Insets(0, kAvatarLeftPadding[mode], | 120 return gfx::Insets(0, kAvatarLeftPadding[mode], |
| (...skipping 19 matching lines...) Expand all Loading... |
| 140 kToolbarBottomPadding[mode], | 140 kToolbarBottomPadding[mode], |
| 141 kToolbarRightPadding[mode]); | 141 kToolbarRightPadding[mode]); |
| 142 case TOOLBAR_BUTTON: { | 142 case TOOLBAR_BUTTON: { |
| 143 const int inset = kToolbarButtonPadding[mode]; | 143 const int inset = kToolbarButtonPadding[mode]; |
| 144 return gfx::Insets(inset, inset, inset, inset); | 144 return gfx::Insets(inset, inset, inset, inset); |
| 145 } | 145 } |
| 146 } | 146 } |
| 147 NOTREACHED(); | 147 NOTREACHED(); |
| 148 return gfx::Insets(); | 148 return gfx::Insets(); |
| 149 } | 149 } |
| OLD | NEW |