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

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

Issue 1543963002: Refactor layout constants in preparation for adding support for Material Hybrid. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@tab_drag_height
Patch Set: Created 5 years 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 | « no previous file | chrome/browser/ui/layout_constants.cc » ('j') | 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 #ifndef CHROME_BROWSER_UI_LAYOUT_CONSTANTS_H_ 5 #ifndef CHROME_BROWSER_UI_LAYOUT_CONSTANTS_H_
6 #define CHROME_BROWSER_UI_LAYOUT_CONSTANTS_H_ 6 #define CHROME_BROWSER_UI_LAYOUT_CONSTANTS_H_
7 7
8 #include "ui/gfx/geometry/insets.h" 8 #include "ui/gfx/geometry/insets.h"
9 #include "ui/gfx/geometry/size.h"
9 10
10 enum LayoutConstant { 11 enum LayoutConstant {
11 // Vertical offset from top of content to the top of find bar. 12 // Vertical offset from top of content to the top of find bar.
12 FIND_BAR_TOOLBAR_OVERLAP, 13 FIND_BAR_TOOLBAR_OVERLAP,
13 14
14 // Horizontal padding applied between items of icon-label views. 15 // Horizontal padding applied between items of icon-label views.
15 ICON_LABEL_VIEW_INTERNAL_PADDING, 16 ICON_LABEL_VIEW_INTERNAL_PADDING,
16 17
17 // Additional horizontal padding applied on the trailing edge of icon-label 18 // Additional horizontal padding applied on the trailing edge of icon-label
18 // views. 19 // views.
(...skipping 13 matching lines...) Expand all
32 // assets. 33 // assets.
33 LOCATION_BAR_HEIGHT, 34 LOCATION_BAR_HEIGHT,
34 35
35 // Space between items in the location bar, as well as between items and the 36 // Space between items in the location bar, as well as between items and the
36 // edges. 37 // edges.
37 LOCATION_BAR_HORIZONTAL_PADDING, 38 LOCATION_BAR_HORIZONTAL_PADDING,
38 39
39 // The vertical padding of items in the location bar. 40 // The vertical padding of items in the location bar.
40 LOCATION_BAR_VERTICAL_PADDING, 41 LOCATION_BAR_VERTICAL_PADDING,
41 42
42 // The width of the New Tab button.
43 NEW_TAB_BUTTON_WIDTH,
44
45 // The number of pixels in the omnibox dropdown border image interior to 43 // The number of pixels in the omnibox dropdown border image interior to
46 // the actual border. 44 // the actual border.
47 OMNIBOX_DROPDOWN_BORDER_INTERIOR, 45 OMNIBOX_DROPDOWN_BORDER_INTERIOR,
48 46
49 // The font size to use in the location bar and omnibox dropdown, in pixels. 47 // The font size to use in the location bar and omnibox dropdown, in pixels.
50 OMNIBOX_FONT_PIXEL_SIZE, 48 OMNIBOX_FONT_PIXEL_SIZE,
51 49
52 // The amount of overlap between the last tab and the new tab button. 50 // The amount of overlap between the last tab and the new tab button.
53 TABSTRIP_NEW_TAB_BUTTON_OVERLAP, 51 TABSTRIP_NEW_TAB_BUTTON_OVERLAP,
54 52
55 // The amount of overlap between two adjacent tabs. 53 // The amount of overlap between two adjacent tabs.
56 TABSTRIP_TAB_OVERLAP, 54 TABSTRIP_TAB_OVERLAP,
57 55
58 // The vertical overlap of the tabstrip atop the toolbar. 56 // The vertical overlap of the tabstrip atop the toolbar.
59 TABSTRIP_TOOLBAR_OVERLAP, 57 TABSTRIP_TOOLBAR_OVERLAP,
60 58
61 // The amount by which the tab close button should overlap the trailing 59 // The amount by which the tab close button should overlap the trailing
62 // padding region after the tab's contents region. 60 // padding region after the tab's contents region.
63 TAB_CLOSE_BUTTON_TRAILING_PADDING_OVERLAP, 61 TAB_CLOSE_BUTTON_TRAILING_PADDING_OVERLAP,
64 62
65 // The horizontal space between a tab's favicon and its title. 63 // The horizontal space between a tab's favicon and its title.
66 TAB_FAVICON_TITLE_SPACING, 64 TAB_FAVICON_TITLE_SPACING,
67 65
68 // The maximum width we'll allow for a tab's title, when the tabstrip is wide 66 // The height of a tab, including outer strokes. In non-100% scales this is
69 // enough for tabs to take as much space as they want. 67 // slightly larger than the apparent height of the tab, as the top stroke is
70 TAB_MAXIMUM_TITLE_WIDTH, 68 // drawn as a 1-px line flush with the bottom of the tab's topmost DIP.
69 TAB_HEIGHT,
71 70
72 // Width available for content inside a pinned tab. 71 // Width available for content inside a pinned tab.
73 TAB_PINNED_CONTENT_WIDTH, 72 TAB_PINNED_CONTENT_WIDTH,
74 73
75 // Height of the region atop the tab bounds that is normally excluded when 74 // Height of the region atop the tab bounds that is normally excluded when
76 // calculating the tab hit test region or considering where to paint a 75 // calculating the tab hit test region or considering where to paint a
77 // custom theme background. (Based on theme behavior it seems like at some 76 // custom theme background. (Based on theme behavior it seems like at some
78 // point this was added to the area above the top of the tab images, and we 77 // point this was added to the area above the top of the tab images, and we
79 // now need to subtract it back off to compensate.) 78 // now need to subtract it back off to compensate.)
80 TAB_TOP_EXCLUSION_HEIGHT, 79 TAB_TOP_EXCLUSION_HEIGHT,
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 TAB, 116 TAB,
118 117
119 // The minimum padding of the toolbar. The edge graphics have some built-in 118 // The minimum padding of the toolbar. The edge graphics have some built-in
120 // spacing, shadowing, so this accounts for that as well. 119 // spacing, shadowing, so this accounts for that as well.
121 TOOLBAR, 120 TOOLBAR,
122 121
123 // The spacing between a ToolbarButton's image and its border. 122 // The spacing between a ToolbarButton's image and its border.
124 TOOLBAR_BUTTON, 123 TOOLBAR_BUTTON,
125 }; 124 };
126 125
126 enum LayoutSize {
127 // The visible size of the new tab button; does not include any Fitts' Law
128 // extensions.
129 NEW_TAB_BUTTON,
130 };
131
127 int GetLayoutConstant(LayoutConstant constant); 132 int GetLayoutConstant(LayoutConstant constant);
128 gfx::Insets GetLayoutInsets(LayoutInset inset); 133 gfx::Insets GetLayoutInsets(LayoutInset inset);
134 gfx::Size GetLayoutSize(LayoutSize size);
129 135
130 #endif // CHROME_BROWSER_UI_LAYOUT_CONSTANTS_H_ 136 #endif // CHROME_BROWSER_UI_LAYOUT_CONSTANTS_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/layout_constants.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698