Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(720)

Side by Side Diff: chrome/browser/ui/views/layout_constants.cc

Issue 1395193002: Fixes BrowserViewHostedAppTest.Layout when using MD (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixes BrowserViewHostedAppTest.Layout when using MD (post-LGTM comments) Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/ui/views/layout_constants.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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) {
11 const int kFindBarVerticalOffset[] = {1, 6, 6};
11 const int kIconLabelViewInternalPadding[] = {3, 2, 2}; 12 const int kIconLabelViewInternalPadding[] = {3, 2, 2};
12 const int kIconLabelViewTrailingPadding[] = {2, 8, 8}; 13 const int kIconLabelViewTrailingPadding[] = {2, 8, 8};
13 const int kLocationBarBubbleHorizontalPadding[] = {1, 5, 5}; 14 const int kLocationBarBubbleHorizontalPadding[] = {1, 5, 5};
14 const int kLocationBarBubbleVerticalPadding[] = {1, 5, 5}; 15 const int kLocationBarBubbleVerticalPadding[] = {1, 5, 5};
15 const int kLocationBarHeight[] = {0, 28, 32}; 16 const int kLocationBarHeight[] = {0, 28, 32};
16 const int kLocationBarHorizontalPadding[] = {3, 6, 6}; 17 const int kLocationBarHorizontalPadding[] = {3, 6, 6};
17 const int kLocationBarVerticalPadding[] = {2, 2, 2}; 18 const int kLocationBarVerticalPadding[] = {2, 2, 2};
18 const int kOmniboxDropdownBorderInterior[] = {6, 0, 0}; 19 const int kOmniboxDropdownBorderInterior[] = {6, 0, 0};
19 const int kOmniboxFontPixelSize[] = {16, 14, 14}; 20 const int kOmniboxFontPixelSize[] = {16, 14, 14};
20 const int kTabCloseButtonTrailingPaddingOverlap[] = {2, 2, 2}; 21 const int kTabCloseButtonTrailingPaddingOverlap[] = {2, 2, 2};
21 const int kTabFaviconTitleSpacing[] = {4, 4, 4}; 22 const int kTabFaviconTitleSpacing[] = {4, 4, 4};
22 const int kTabMaximumTitleWidth[] = {175, 175, 175}; 23 const int kTabMaximumTitleWidth[] = {175, 175, 175};
23 const int kTabPinnedContentWidth[] = {25, 25, 25}; 24 const int kTabPinnedContentWidth[] = {25, 25, 25};
24 #if defined(OS_MACOSX) 25 #if defined(OS_MACOSX)
25 const int kTabstripTabOverlap[] = {19, 19, 19}; 26 const int kTabstripTabOverlap[] = {19, 19, 19};
26 #else 27 #else
27 const int kTabstripTabOverlap[] = {26, 26, 26}; 28 const int kTabstripTabOverlap[] = {26, 26, 26};
28 #endif 29 #endif
29 const int kTabstripToolbarOverlap[] = {3, 3, 3}; 30 const int kTabstripToolbarOverlap[] = {3, 3, 3};
30 const int kToolbarContentShadowHeight[] = {0, 0, 0}; 31 const int kToolbarContentShadowHeight[] = {0, 0, 0};
31 const int kToolbarContentShadowHeightAsh[] = {2, 0, 0}; 32 const int kToolbarContentShadowHeightAsh[] = {2, 0, 0};
32 const int kToolbarElementPadding[] = {0, 0, 8}; 33 const int kToolbarElementPadding[] = {0, 0, 8};
33 const int kToolbarLocationBarRightPadding[] = {0, 4, 8}; 34 const int kToolbarLocationBarRightPadding[] = {0, 4, 8};
34 const int kToolbarStandardSpacing[] = {3, 4, 8}; 35 const int kToolbarStandardSpacing[] = {3, 4, 8};
35 36
36 const int mode = ui::MaterialDesignController::GetMode(); 37 const int mode = ui::MaterialDesignController::GetMode();
37 switch (constant) { 38 switch (constant) {
39 case FIND_BAR_TOOLBAR_OVERLAP:
40 return kFindBarVerticalOffset[mode];
38 case ICON_LABEL_VIEW_INTERNAL_PADDING: 41 case ICON_LABEL_VIEW_INTERNAL_PADDING:
39 return kIconLabelViewInternalPadding[mode]; 42 return kIconLabelViewInternalPadding[mode];
40 case ICON_LABEL_VIEW_TRAILING_PADDING: 43 case ICON_LABEL_VIEW_TRAILING_PADDING:
41 return kIconLabelViewTrailingPadding[mode]; 44 return kIconLabelViewTrailingPadding[mode];
42 case LOCATION_BAR_BUBBLE_HORIZONTAL_PADDING: 45 case LOCATION_BAR_BUBBLE_HORIZONTAL_PADDING:
43 return kLocationBarBubbleHorizontalPadding[mode]; 46 return kLocationBarBubbleHorizontalPadding[mode];
44 case LOCATION_BAR_BUBBLE_VERTICAL_PADDING: 47 case LOCATION_BAR_BUBBLE_VERTICAL_PADDING:
45 return kLocationBarBubbleVerticalPadding[mode]; 48 return kLocationBarBubbleVerticalPadding[mode];
46 case LOCATION_BAR_HEIGHT: 49 case LOCATION_BAR_HEIGHT:
47 return kLocationBarHeight[mode]; 50 return kLocationBarHeight[mode];
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/layout_constants.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698