| 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 "build/build_config.h" | 8 #include "build/build_config.h" |
| 9 #include "ui/base/material_design/material_design_controller.h" | 9 #include "ui/base/material_design/material_design_controller.h" |
| 10 | 10 |
| 11 int GetLayoutConstant(LayoutConstant constant) { | 11 int GetLayoutConstant(LayoutConstant constant) { |
| 12 const int kFindBarVerticalOffset[] = {1, 6, 6}; | 12 const int kFindBarVerticalOffset[] = {1, 6, 6}; |
| 13 const int kIconLabelViewInternalSpacing[] = {3, 5, 5}; | |
| 14 const int kIconLabelViewTrailingPadding[] = {2, 6, 6}; | |
| 15 const int kLocationBarBorderThickness[] = {2, 1, 1}; | 13 const int kLocationBarBorderThickness[] = {2, 1, 1}; |
| 16 const int kLocationBarBubbleFontVerticalPadding[] = {1, 2, 4}; | 14 const int kLocationBarBubbleFontVerticalPadding[] = {1, 2, 4}; |
| 17 const int kLocationBarBubbleHorizontalPadding[] = {1, 0, 0}; | 15 const int kLocationBarBubbleHorizontalPadding[] = {1, 0, 0}; |
| 18 const int kLocationBarBubbleVerticalPadding[] = {1, 3, 3}; | 16 const int kLocationBarBubbleVerticalPadding[] = {1, 3, 3}; |
| 19 const int kLocationBarBubbleAnchorVerticalInset[] = {5, 6, 8}; | 17 const int kLocationBarBubbleAnchorVerticalInset[] = {5, 6, 8}; |
| 20 const int kLocationBarHeight[] = {27, 28, 32}; | 18 const int kLocationBarHeight[] = {27, 28, 32}; |
| 21 const int kLocationBarHorizontalPadding[] = {3, 6, 6}; | 19 const int kLocationBarHorizontalPadding[] = {3, 6, 6}; |
| 22 const int kLocationBarVerticalPadding[] = {0, 1, 1}; | 20 const int kLocationBarVerticalPadding[] = {0, 1, 1}; |
| 23 const int kOmniboxDropdownBorderInterior[] = {6, 0, 0}; | 21 const int kOmniboxDropdownBorderInterior[] = {6, 0, 0}; |
| 24 const int kOmniboxFontPixelSize[] = {16, 14, 14}; | 22 const int kOmniboxFontPixelSize[] = {16, 14, 14}; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 39 const int kTabstripToolbarOverlap[] = {3, 0, 0}; | 37 const int kTabstripToolbarOverlap[] = {3, 0, 0}; |
| 40 const int kToolbarContentShadowHeight[] = {0, 0, 0}; | 38 const int kToolbarContentShadowHeight[] = {0, 0, 0}; |
| 41 const int kToolbarContentShadowHeightAsh[] = {2, 0, 0}; | 39 const int kToolbarContentShadowHeightAsh[] = {2, 0, 0}; |
| 42 const int kToolbarElementPadding[] = {0, 0, 8}; | 40 const int kToolbarElementPadding[] = {0, 0, 8}; |
| 43 const int kToolbarLocationBarRightPadding[] = {0, 4, 8}; | 41 const int kToolbarLocationBarRightPadding[] = {0, 4, 8}; |
| 44 | 42 |
| 45 const int mode = ui::MaterialDesignController::GetMode(); | 43 const int mode = ui::MaterialDesignController::GetMode(); |
| 46 switch (constant) { | 44 switch (constant) { |
| 47 case FIND_BAR_TOOLBAR_OVERLAP: | 45 case FIND_BAR_TOOLBAR_OVERLAP: |
| 48 return kFindBarVerticalOffset[mode]; | 46 return kFindBarVerticalOffset[mode]; |
| 49 case ICON_LABEL_VIEW_INTERNAL_SPACING: | |
| 50 return kIconLabelViewInternalSpacing[mode]; | |
| 51 case ICON_LABEL_VIEW_TRAILING_PADDING: | |
| 52 return kIconLabelViewTrailingPadding[mode]; | |
| 53 case LOCATION_BAR_BORDER_THICKNESS: | 47 case LOCATION_BAR_BORDER_THICKNESS: |
| 54 return kLocationBarBorderThickness[mode]; | 48 return kLocationBarBorderThickness[mode]; |
| 55 case LOCATION_BAR_BUBBLE_FONT_VERTICAL_PADDING: | 49 case LOCATION_BAR_BUBBLE_FONT_VERTICAL_PADDING: |
| 56 return kLocationBarBubbleFontVerticalPadding[mode]; | 50 return kLocationBarBubbleFontVerticalPadding[mode]; |
| 57 case LOCATION_BAR_BUBBLE_HORIZONTAL_PADDING: | 51 case LOCATION_BAR_BUBBLE_HORIZONTAL_PADDING: |
| 58 return kLocationBarBubbleHorizontalPadding[mode]; | 52 return kLocationBarBubbleHorizontalPadding[mode]; |
| 59 case LOCATION_BAR_BUBBLE_VERTICAL_PADDING: | 53 case LOCATION_BAR_BUBBLE_VERTICAL_PADDING: |
| 60 return kLocationBarBubbleVerticalPadding[mode]; | 54 return kLocationBarBubbleVerticalPadding[mode]; |
| 61 case LOCATION_BAR_BUBBLE_ANCHOR_VERTICAL_INSET: | 55 case LOCATION_BAR_BUBBLE_ANCHOR_VERTICAL_INSET: |
| 62 return kLocationBarBubbleAnchorVerticalInset[mode]; | 56 return kLocationBarBubbleAnchorVerticalInset[mode]; |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 const int kNewTabButtonHeight[] = {18, 18, 21}; | 142 const int kNewTabButtonHeight[] = {18, 18, 21}; |
| 149 | 143 |
| 150 const int mode = ui::MaterialDesignController::GetMode(); | 144 const int mode = ui::MaterialDesignController::GetMode(); |
| 151 switch (size) { | 145 switch (size) { |
| 152 case NEW_TAB_BUTTON: | 146 case NEW_TAB_BUTTON: |
| 153 return gfx::Size(kNewTabButtonWidth[mode], kNewTabButtonHeight[mode]); | 147 return gfx::Size(kNewTabButtonWidth[mode], kNewTabButtonHeight[mode]); |
| 154 } | 148 } |
| 155 NOTREACHED(); | 149 NOTREACHED(); |
| 156 return gfx::Size(); | 150 return gfx::Size(); |
| 157 } | 151 } |
| OLD | NEW |