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/views/layout_constants.h" | 5 #include "chrome/browser/ui/views/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) { |
(...skipping 14 matching lines...) Expand all Loading... |
25 const int kTabstripTabOverlap[] = {19, 19, 19}; | 25 const int kTabstripTabOverlap[] = {19, 19, 19}; |
26 #else | 26 #else |
27 const int kTabstripTabOverlap[] = {26, 26, 26}; | 27 const int kTabstripTabOverlap[] = {26, 26, 26}; |
28 #endif | 28 #endif |
29 const int kTabstripToolbarOverlap[] = {3, 3, 3}; | 29 const int kTabstripToolbarOverlap[] = {3, 3, 3}; |
30 const int kToolbarContentShadowHeight[] = {0, 0, 0}; | 30 const int kToolbarContentShadowHeight[] = {0, 0, 0}; |
31 const int kToolbarContentShadowHeightAsh[] = {2, 0, 0}; | 31 const int kToolbarContentShadowHeightAsh[] = {2, 0, 0}; |
32 const int kToolbarElementPadding[] = {0, 0, 8}; | 32 const int kToolbarElementPadding[] = {0, 0, 8}; |
33 const int kToolbarLocationBarRightPadding[] = {0, 4, 8}; | 33 const int kToolbarLocationBarRightPadding[] = {0, 4, 8}; |
34 const int kToolbarStandardSpacing[] = {3, 4, 8}; | 34 const int kToolbarStandardSpacing[] = {3, 4, 8}; |
| 35 const int kFindBarVerticalOffset[] = {1, 6, 6}; |
35 | 36 |
36 const int mode = ui::MaterialDesignController::GetMode(); | 37 const int mode = ui::MaterialDesignController::GetMode(); |
37 switch (constant) { | 38 switch (constant) { |
38 case ICON_LABEL_VIEW_INTERNAL_PADDING: | 39 case ICON_LABEL_VIEW_INTERNAL_PADDING: |
39 return kIconLabelViewInternalPadding[mode]; | 40 return kIconLabelViewInternalPadding[mode]; |
40 case ICON_LABEL_VIEW_TRAILING_PADDING: | 41 case ICON_LABEL_VIEW_TRAILING_PADDING: |
41 return kIconLabelViewTrailingPadding[mode]; | 42 return kIconLabelViewTrailingPadding[mode]; |
42 case LOCATION_BAR_BUBBLE_HORIZONTAL_PADDING: | 43 case LOCATION_BAR_BUBBLE_HORIZONTAL_PADDING: |
43 return kLocationBarBubbleHorizontalPadding[mode]; | 44 return kLocationBarBubbleHorizontalPadding[mode]; |
44 case LOCATION_BAR_BUBBLE_VERTICAL_PADDING: | 45 case LOCATION_BAR_BUBBLE_VERTICAL_PADDING: |
(...skipping 23 matching lines...) Expand all Loading... |
68 case TOOLBAR_CONTENT_SHADOW_HEIGHT: | 69 case TOOLBAR_CONTENT_SHADOW_HEIGHT: |
69 return kToolbarContentShadowHeight[mode]; | 70 return kToolbarContentShadowHeight[mode]; |
70 case TOOLBAR_CONTENT_SHADOW_HEIGHT_ASH: | 71 case TOOLBAR_CONTENT_SHADOW_HEIGHT_ASH: |
71 return kToolbarContentShadowHeightAsh[mode]; | 72 return kToolbarContentShadowHeightAsh[mode]; |
72 case TOOLBAR_ELEMENT_PADDING: | 73 case TOOLBAR_ELEMENT_PADDING: |
73 return kToolbarElementPadding[mode]; | 74 return kToolbarElementPadding[mode]; |
74 case TOOLBAR_LOCATION_BAR_RIGHT_PADDING: | 75 case TOOLBAR_LOCATION_BAR_RIGHT_PADDING: |
75 return kToolbarLocationBarRightPadding[mode]; | 76 return kToolbarLocationBarRightPadding[mode]; |
76 case TOOLBAR_STANDARD_SPACING: | 77 case TOOLBAR_STANDARD_SPACING: |
77 return kToolbarStandardSpacing[mode]; | 78 return kToolbarStandardSpacing[mode]; |
| 79 case FIND_BAR_VERTICAL_OFFSET: |
| 80 return kFindBarVerticalOffset[mode]; |
78 } | 81 } |
79 NOTREACHED(); | 82 NOTREACHED(); |
80 return 0; | 83 return 0; |
81 } | 84 } |
82 | 85 |
83 gfx::Insets GetLayoutInsets(LayoutInset inset) { | 86 gfx::Insets GetLayoutInsets(LayoutInset inset) { |
84 const int kAvatarLeftPadding[] = {2, 4, 4}; | 87 const int kAvatarLeftPadding[] = {2, 4, 4}; |
85 const int kAvatarRightPadding[] = {2, 2, 2}; | 88 const int kAvatarRightPadding[] = {2, 2, 2}; |
86 const int kAvatarBottomPadding[] = {2, 4, 4}; | 89 const int kAvatarBottomPadding[] = {2, 4, 4}; |
87 const int kOmniboxDropdownIconPadding[] = {2, 4, 8}; | 90 const int kOmniboxDropdownIconPadding[] = {2, 4, 8}; |
(...skipping 30 matching lines...) Expand all Loading... |
118 kToolbarBottomPadding[mode], | 121 kToolbarBottomPadding[mode], |
119 kToolbarRightPadding[mode]); | 122 kToolbarRightPadding[mode]); |
120 case TOOLBAR_BUTTON: { | 123 case TOOLBAR_BUTTON: { |
121 const int inset = kToolbarButtonPadding[mode]; | 124 const int inset = kToolbarButtonPadding[mode]; |
122 return gfx::Insets(inset, inset, inset, inset); | 125 return gfx::Insets(inset, inset, inset, inset); |
123 } | 126 } |
124 } | 127 } |
125 NOTREACHED(); | 128 NOTREACHED(); |
126 return gfx::Insets(); | 129 return gfx::Insets(); |
127 } | 130 } |
OLD | NEW |