| 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 kIconLabelViewInternalPadding[] = {3, 2, 2}; | 13 const int kIconLabelViewInternalPadding[] = {3, 2, 2}; |
| 14 const int kIconLabelViewTrailingPadding[] = {2, 8, 8}; | 14 const int kIconLabelViewTrailingPadding[] = {2, 8, 8}; |
| 15 const int kLocationBarBorderThickness[] = {2, 1, 1}; | 15 const int kLocationBarBorderThickness[] = {2, 1, 1}; |
| 16 const int kLocationBarBubbleFontVerticalPadding[] = {1, 2, 4}; |
| 16 const int kLocationBarBubbleHorizontalPadding[] = {1, 4, 4}; | 17 const int kLocationBarBubbleHorizontalPadding[] = {1, 4, 4}; |
| 17 const int kLocationBarBubbleVerticalPadding[] = {1, 3, 3}; | 18 const int kLocationBarBubbleVerticalPadding[] = {1, 3, 3}; |
| 18 const int kLocationBarHeight[] = {27, 28, 32}; | 19 const int kLocationBarHeight[] = {27, 28, 32}; |
| 19 const int kLocationBarHorizontalPadding[] = {3, 6, 6}; | 20 const int kLocationBarHorizontalPadding[] = {3, 6, 6}; |
| 20 const int kLocationBarVerticalPadding[] = {0, 1, 1}; | 21 const int kLocationBarVerticalPadding[] = {0, 1, 1}; |
| 21 const int kOmniboxDropdownBorderInterior[] = {6, 0, 0}; | 22 const int kOmniboxDropdownBorderInterior[] = {6, 0, 0}; |
| 22 const int kOmniboxFontPixelSize[] = {16, 14, 14}; | 23 const int kOmniboxFontPixelSize[] = {16, 14, 14}; |
| 23 const int kTabCloseButtonTrailingPaddingOverlap[] = {2, 0, 0}; | 24 const int kTabCloseButtonTrailingPaddingOverlap[] = {2, 0, 0}; |
| 24 const int kTabFaviconTitleSpacing[] = {4, 6, 6}; | 25 const int kTabFaviconTitleSpacing[] = {4, 6, 6}; |
| 25 const int kTabHeight[] = {29, 29, 33}; | 26 const int kTabHeight[] = {29, 29, 33}; |
| (...skipping 17 matching lines...) Expand all Loading... |
| 43 const int mode = ui::MaterialDesignController::GetMode(); | 44 const int mode = ui::MaterialDesignController::GetMode(); |
| 44 switch (constant) { | 45 switch (constant) { |
| 45 case FIND_BAR_TOOLBAR_OVERLAP: | 46 case FIND_BAR_TOOLBAR_OVERLAP: |
| 46 return kFindBarVerticalOffset[mode]; | 47 return kFindBarVerticalOffset[mode]; |
| 47 case ICON_LABEL_VIEW_INTERNAL_PADDING: | 48 case ICON_LABEL_VIEW_INTERNAL_PADDING: |
| 48 return kIconLabelViewInternalPadding[mode]; | 49 return kIconLabelViewInternalPadding[mode]; |
| 49 case ICON_LABEL_VIEW_TRAILING_PADDING: | 50 case ICON_LABEL_VIEW_TRAILING_PADDING: |
| 50 return kIconLabelViewTrailingPadding[mode]; | 51 return kIconLabelViewTrailingPadding[mode]; |
| 51 case LOCATION_BAR_BORDER_THICKNESS: | 52 case LOCATION_BAR_BORDER_THICKNESS: |
| 52 return kLocationBarBorderThickness[mode]; | 53 return kLocationBarBorderThickness[mode]; |
| 54 case LOCATION_BAR_BUBBLE_FONT_VERTICAL_PADDING: |
| 55 return kLocationBarBubbleFontVerticalPadding[mode]; |
| 53 case LOCATION_BAR_BUBBLE_HORIZONTAL_PADDING: | 56 case LOCATION_BAR_BUBBLE_HORIZONTAL_PADDING: |
| 54 return kLocationBarBubbleHorizontalPadding[mode]; | 57 return kLocationBarBubbleHorizontalPadding[mode]; |
| 55 case LOCATION_BAR_BUBBLE_VERTICAL_PADDING: | 58 case LOCATION_BAR_BUBBLE_VERTICAL_PADDING: |
| 56 return kLocationBarBubbleVerticalPadding[mode]; | 59 return kLocationBarBubbleVerticalPadding[mode]; |
| 57 case LOCATION_BAR_HEIGHT: | 60 case LOCATION_BAR_HEIGHT: |
| 58 return kLocationBarHeight[mode]; | 61 return kLocationBarHeight[mode]; |
| 59 case LOCATION_BAR_HORIZONTAL_PADDING: | 62 case LOCATION_BAR_HORIZONTAL_PADDING: |
| 60 return kLocationBarHorizontalPadding[mode]; | 63 return kLocationBarHorizontalPadding[mode]; |
| 61 case LOCATION_BAR_VERTICAL_PADDING: | 64 case LOCATION_BAR_VERTICAL_PADDING: |
| 62 return kLocationBarVerticalPadding[mode]; | 65 return kLocationBarVerticalPadding[mode]; |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 const int kNewTabButtonHeight[] = {18, 18, 21}; | 153 const int kNewTabButtonHeight[] = {18, 18, 21}; |
| 151 | 154 |
| 152 const int mode = ui::MaterialDesignController::GetMode(); | 155 const int mode = ui::MaterialDesignController::GetMode(); |
| 153 switch (size) { | 156 switch (size) { |
| 154 case NEW_TAB_BUTTON: | 157 case NEW_TAB_BUTTON: |
| 155 return gfx::Size(kNewTabButtonWidth[mode], kNewTabButtonHeight[mode]); | 158 return gfx::Size(kNewTabButtonWidth[mode], kNewTabButtonHeight[mode]); |
| 156 } | 159 } |
| 157 NOTREACHED(); | 160 NOTREACHED(); |
| 158 return gfx::Size(); | 161 return gfx::Size(); |
| 159 } | 162 } |
| OLD | NEW |