| 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 kAshBrowserMaximizedHeaderButtonHeight[] = {27, 32, 36}; |
| 12 const int kAshBrowserMaximizedHeaderButtonWidth[] = {35, 32, 32}; |
| 13 const int kAshBrowserRestoredHeaderButtonHeight[] = {35, 36, 40}; |
| 14 const int kAshBrowserRestoredHeaderButtonWidth[] = {35, 32, 32}; |
| 11 const int kFindBarVerticalOffset[] = {1, 6, 6}; | 15 const int kFindBarVerticalOffset[] = {1, 6, 6}; |
| 12 const int kIconLabelViewInternalPadding[] = {3, 2, 2}; | 16 const int kIconLabelViewInternalPadding[] = {3, 2, 2}; |
| 13 const int kIconLabelViewTrailingPadding[] = {2, 8, 8}; | 17 const int kIconLabelViewTrailingPadding[] = {2, 8, 8}; |
| 14 const int kLocationBarBorderThickness[] = {2, 1, 1}; | 18 const int kLocationBarBorderThickness[] = {2, 1, 1}; |
| 15 const int kLocationBarBubbleHorizontalPadding[] = {1, 4, 4}; | 19 const int kLocationBarBubbleHorizontalPadding[] = {1, 4, 4}; |
| 16 const int kLocationBarBubbleVerticalPadding[] = {1, 4, 4}; | 20 const int kLocationBarBubbleVerticalPadding[] = {1, 4, 4}; |
| 17 const int kLocationBarHeight[] = {27, 28, 32}; | 21 const int kLocationBarHeight[] = {27, 28, 32}; |
| 18 const int kLocationBarHorizontalPadding[] = {3, 6, 6}; | 22 const int kLocationBarHorizontalPadding[] = {3, 6, 6}; |
| 19 const int kLocationBarVerticalPadding[] = {2, 2, 2}; | 23 const int kLocationBarVerticalPadding[] = {2, 2, 2}; |
| 20 const int kNewTabButtonWidth[] = {34, 36, 36}; | 24 const int kNewTabButtonWidth[] = {34, 36, 36}; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 35 #endif | 39 #endif |
| 36 const int kTabstripToolbarOverlap[] = {3, 0, 0}; | 40 const int kTabstripToolbarOverlap[] = {3, 0, 0}; |
| 37 const int kToolbarContentShadowHeight[] = {0, 0, 0}; | 41 const int kToolbarContentShadowHeight[] = {0, 0, 0}; |
| 38 const int kToolbarContentShadowHeightAsh[] = {2, 0, 0}; | 42 const int kToolbarContentShadowHeightAsh[] = {2, 0, 0}; |
| 39 const int kToolbarElementPadding[] = {0, 0, 8}; | 43 const int kToolbarElementPadding[] = {0, 0, 8}; |
| 40 const int kToolbarLocationBarRightPadding[] = {0, 4, 8}; | 44 const int kToolbarLocationBarRightPadding[] = {0, 4, 8}; |
| 41 const int kToolbarStandardSpacing[] = {3, 4, 8}; | 45 const int kToolbarStandardSpacing[] = {3, 4, 8}; |
| 42 | 46 |
| 43 const int mode = ui::MaterialDesignController::GetMode(); | 47 const int mode = ui::MaterialDesignController::GetMode(); |
| 44 switch (constant) { | 48 switch (constant) { |
| 49 case ASH_BROWSER_MAXIMIZED_HEADER_BUTTON_HEIGHT: |
| 50 return kAshBrowserMaximizedHeaderButtonHeight[mode]; |
| 51 case ASH_BROWSER_MAXIMIZED_HEADER_BUTTON_WIDTH: |
| 52 return kAshBrowserMaximizedHeaderButtonWidth[mode]; |
| 53 case ASH_BROWSER_RESTORED_HEADER_BUTTON_HEIGHT: |
| 54 return kAshBrowserRestoredHeaderButtonHeight[mode]; |
| 55 case ASH_BROWSER_RESTORED_HEADER_BUTTON_WIDTH: |
| 56 return kAshBrowserRestoredHeaderButtonWidth[mode]; |
| 45 case FIND_BAR_TOOLBAR_OVERLAP: | 57 case FIND_BAR_TOOLBAR_OVERLAP: |
| 46 return kFindBarVerticalOffset[mode]; | 58 return kFindBarVerticalOffset[mode]; |
| 47 case ICON_LABEL_VIEW_INTERNAL_PADDING: | 59 case ICON_LABEL_VIEW_INTERNAL_PADDING: |
| 48 return kIconLabelViewInternalPadding[mode]; | 60 return kIconLabelViewInternalPadding[mode]; |
| 49 case ICON_LABEL_VIEW_TRAILING_PADDING: | 61 case ICON_LABEL_VIEW_TRAILING_PADDING: |
| 50 return kIconLabelViewTrailingPadding[mode]; | 62 return kIconLabelViewTrailingPadding[mode]; |
| 51 case LOCATION_BAR_BORDER_THICKNESS: | 63 case LOCATION_BAR_BORDER_THICKNESS: |
| 52 return kLocationBarBorderThickness[mode]; | 64 return kLocationBarBorderThickness[mode]; |
| 53 case LOCATION_BAR_BUBBLE_HORIZONTAL_PADDING: | 65 case LOCATION_BAR_BUBBLE_HORIZONTAL_PADDING: |
| 54 return kLocationBarBubbleHorizontalPadding[mode]; | 66 return kLocationBarBubbleHorizontalPadding[mode]; |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 kToolbarBottomPadding[mode], | 152 kToolbarBottomPadding[mode], |
| 141 kToolbarRightPadding[mode]); | 153 kToolbarRightPadding[mode]); |
| 142 case TOOLBAR_BUTTON: { | 154 case TOOLBAR_BUTTON: { |
| 143 const int inset = kToolbarButtonPadding[mode]; | 155 const int inset = kToolbarButtonPadding[mode]; |
| 144 return gfx::Insets(inset, inset, inset, inset); | 156 return gfx::Insets(inset, inset, inset, inset); |
| 145 } | 157 } |
| 146 } | 158 } |
| 147 NOTREACHED(); | 159 NOTREACHED(); |
| 148 return gfx::Insets(); | 160 return gfx::Insets(); |
| 149 } | 161 } |
| OLD | NEW |