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

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

Issue 2364163002: Views - draw omnibox popup shadows (Closed)
Patch Set: shorten comment Created 4 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
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/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 kLocationBarBorderThickness[] = {2, 1, 1}; 13 const int kLocationBarBorderThickness[] = {2, 1, 1};
14 const int kLocationBarBubbleFontVerticalPadding[] = {1, 2, 4}; 14 const int kLocationBarBubbleFontVerticalPadding[] = {1, 2, 4};
15 const int kLocationBarBubbleHorizontalPadding[] = {1, 0, 0}; 15 const int kLocationBarBubbleHorizontalPadding[] = {1, 0, 0};
16 const int kLocationBarBubbleVerticalPadding[] = {1, 3, 3}; 16 const int kLocationBarBubbleVerticalPadding[] = {1, 3, 3};
17 const int kLocationBarBubbleAnchorVerticalInset[] = {5, 6, 8}; 17 const int kLocationBarBubbleAnchorVerticalInset[] = {5, 6, 8};
18 const int kLocationBarHeight[] = {27, 28, 32}; 18 const int kLocationBarHeight[] = {27, 28, 32};
19 const int kLocationBarHorizontalPadding[] = {3, 6, 6}; 19 const int kLocationBarHorizontalPadding[] = {3, 6, 6};
20 const int kLocationBarVerticalPadding[] = {0, 1, 1}; 20 const int kLocationBarVerticalPadding[] = {0, 1, 1};
21 const int kOmniboxDropdownBorderInterior[] = {6, 0, 0};
22 const int kOmniboxFontPixelSize[] = {16, 14, 14}; 21 const int kOmniboxFontPixelSize[] = {16, 14, 14};
23 const int kTabFaviconTitleSpacing[] = {4, 6, 6}; 22 const int kTabFaviconTitleSpacing[] = {4, 6, 6};
24 const int kTabHeight[] = {29, 29, 33}; 23 const int kTabHeight[] = {29, 29, 33};
25 const int kTabPinnedContentWidth[] = {25, 23, 23}; 24 const int kTabPinnedContentWidth[] = {25, 23, 23};
26 #if defined(OS_MACOSX) 25 #if defined(OS_MACOSX)
27 const int kTabstripNewTabButtonOverlap[] = {8, 5, 6}; 26 const int kTabstripNewTabButtonOverlap[] = {8, 5, 6};
28 const int kTabstripTabOverlap[] = {19, 16, 16}; 27 const int kTabstripTabOverlap[] = {19, 16, 16};
29 #else 28 #else
30 const int kTabstripNewTabButtonOverlap[] = {11, 5, 6}; 29 const int kTabstripNewTabButtonOverlap[] = {11, 5, 6};
31 const int kTabstripTabOverlap[] = {26, 16, 16}; 30 const int kTabstripTabOverlap[] = {26, 16, 16};
(...skipping 15 matching lines...) Expand all
47 case LOCATION_BAR_BUBBLE_VERTICAL_PADDING: 46 case LOCATION_BAR_BUBBLE_VERTICAL_PADDING:
48 return kLocationBarBubbleVerticalPadding[mode]; 47 return kLocationBarBubbleVerticalPadding[mode];
49 case LOCATION_BAR_BUBBLE_ANCHOR_VERTICAL_INSET: 48 case LOCATION_BAR_BUBBLE_ANCHOR_VERTICAL_INSET:
50 return kLocationBarBubbleAnchorVerticalInset[mode]; 49 return kLocationBarBubbleAnchorVerticalInset[mode];
51 case LOCATION_BAR_HEIGHT: 50 case LOCATION_BAR_HEIGHT:
52 return kLocationBarHeight[mode]; 51 return kLocationBarHeight[mode];
53 case LOCATION_BAR_HORIZONTAL_PADDING: 52 case LOCATION_BAR_HORIZONTAL_PADDING:
54 return kLocationBarHorizontalPadding[mode]; 53 return kLocationBarHorizontalPadding[mode];
55 case LOCATION_BAR_VERTICAL_PADDING: 54 case LOCATION_BAR_VERTICAL_PADDING:
56 return kLocationBarVerticalPadding[mode]; 55 return kLocationBarVerticalPadding[mode];
57 case OMNIBOX_DROPDOWN_BORDER_INTERIOR:
58 return kOmniboxDropdownBorderInterior[mode];
59 case OMNIBOX_FONT_PIXEL_SIZE: 56 case OMNIBOX_FONT_PIXEL_SIZE:
60 return kOmniboxFontPixelSize[mode]; 57 return kOmniboxFontPixelSize[mode];
61 case TABSTRIP_NEW_TAB_BUTTON_OVERLAP: 58 case TABSTRIP_NEW_TAB_BUTTON_OVERLAP:
62 return kTabstripNewTabButtonOverlap[mode]; 59 return kTabstripNewTabButtonOverlap[mode];
63 case TABSTRIP_TAB_OVERLAP: 60 case TABSTRIP_TAB_OVERLAP:
64 return kTabstripTabOverlap[mode]; 61 return kTabstripTabOverlap[mode];
65 case TAB_FAVICON_TITLE_SPACING: 62 case TAB_FAVICON_TITLE_SPACING:
66 return kTabFaviconTitleSpacing[mode]; 63 return kTabFaviconTitleSpacing[mode];
67 case TAB_HEIGHT: 64 case TAB_HEIGHT:
68 return kTabHeight[mode]; 65 return kTabHeight[mode];
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 const int kNewTabButtonHeight[] = {18, 18, 21}; 122 const int kNewTabButtonHeight[] = {18, 18, 21};
126 123
127 const int mode = ui::MaterialDesignController::GetMode(); 124 const int mode = ui::MaterialDesignController::GetMode();
128 switch (size) { 125 switch (size) {
129 case NEW_TAB_BUTTON: 126 case NEW_TAB_BUTTON:
130 return gfx::Size(kNewTabButtonWidth[mode], kNewTabButtonHeight[mode]); 127 return gfx::Size(kNewTabButtonWidth[mode], kNewTabButtonHeight[mode]);
131 } 128 }
132 NOTREACHED(); 129 NOTREACHED();
133 return gfx::Size(); 130 return gfx::Size();
134 } 131 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/layout_constants.h ('k') | chrome/browser/ui/views/omnibox/omnibox_popup_contents_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698