| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_UI_VIEWS_LAYOUT_CONSTANTS_H_ | |
| 6 #define CHROME_BROWSER_UI_VIEWS_LAYOUT_CONSTANTS_H_ | |
| 7 | |
| 8 #include "ui/gfx/geometry/insets.h" | |
| 9 | |
| 10 enum LayoutConstant { | |
| 11 // Vertical offset from top of content to the top of find bar. | |
| 12 FIND_BAR_TOOLBAR_OVERLAP, | |
| 13 | |
| 14 // Horizontal padding applied between items of icon-label views. | |
| 15 ICON_LABEL_VIEW_INTERNAL_PADDING, | |
| 16 | |
| 17 // Additional horizontal padding applied on the trailing edge of icon-label | |
| 18 // views. | |
| 19 ICON_LABEL_VIEW_TRAILING_PADDING, | |
| 20 | |
| 21 // The thickness of the location bar's border. | |
| 22 LOCATION_BAR_BORDER_THICKNESS, | |
| 23 | |
| 24 // The horizontal space between the edge and a bubble. | |
| 25 LOCATION_BAR_BUBBLE_HORIZONTAL_PADDING, | |
| 26 | |
| 27 // The additional vertical padding of a bubble. | |
| 28 LOCATION_BAR_BUBBLE_VERTICAL_PADDING, | |
| 29 | |
| 30 // The height to be occupied by the LocationBar. For | |
| 31 // MaterialDesignController::NON_MATERIAL the height is determined from image | |
| 32 // assets. | |
| 33 LOCATION_BAR_HEIGHT, | |
| 34 | |
| 35 // Space between items in the location bar, as well as between items and the | |
| 36 // edges. | |
| 37 LOCATION_BAR_HORIZONTAL_PADDING, | |
| 38 | |
| 39 // The vertical padding of items in the location bar. | |
| 40 LOCATION_BAR_VERTICAL_PADDING, | |
| 41 | |
| 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 | |
| 46 // the actual border. | |
| 47 OMNIBOX_DROPDOWN_BORDER_INTERIOR, | |
| 48 | |
| 49 // The font size to use in the location bar and omnibox dropdown, in pixels. | |
| 50 OMNIBOX_FONT_PIXEL_SIZE, | |
| 51 | |
| 52 // The amount of overlap between the last tab and the new tab button. | |
| 53 TABSTRIP_NEW_TAB_BUTTON_OVERLAP, | |
| 54 | |
| 55 // The amount of overlap between two adjacent tabs. | |
| 56 TABSTRIP_TAB_OVERLAP, | |
| 57 | |
| 58 // The vertical overlap of the tabstrip atop the toolbar. | |
| 59 TABSTRIP_TOOLBAR_OVERLAP, | |
| 60 | |
| 61 // The amount by which the tab close button should overlap the trailing | |
| 62 // padding region after the tab's contents region. | |
| 63 TAB_CLOSE_BUTTON_TRAILING_PADDING_OVERLAP, | |
| 64 | |
| 65 // The horizontal space between a tab's favicon and its title. | |
| 66 TAB_FAVICON_TITLE_SPACING, | |
| 67 | |
| 68 // The maximum width we'll allow for a tab's title, when the tabstrip is wide | |
| 69 // enough for tabs to take as much space as they want. | |
| 70 TAB_MAXIMUM_TITLE_WIDTH, | |
| 71 | |
| 72 // Width available for content inside a pinned tab. | |
| 73 TAB_PINNED_CONTENT_WIDTH, | |
| 74 | |
| 75 // 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 | |
| 77 // 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 | |
| 79 // now need to subtract it back off to compensate.) | |
| 80 TAB_TOP_EXCLUSION_HEIGHT, | |
| 81 | |
| 82 // Non-ash uses a rounded content area with no shadow in the assets. | |
| 83 // Ash doesn't use a rounded content area and its top edge has an extra | |
| 84 // shadow. | |
| 85 TOOLBAR_CONTENT_SHADOW_HEIGHT, | |
| 86 TOOLBAR_CONTENT_SHADOW_HEIGHT_ASH, | |
| 87 | |
| 88 // Additional horizontal padding between the elements in the toolbar. | |
| 89 TOOLBAR_ELEMENT_PADDING, | |
| 90 | |
| 91 // Padding between the right-edge of the location bar and browser actions. | |
| 92 TOOLBAR_LOCATION_BAR_RIGHT_PADDING, | |
| 93 | |
| 94 // The horizontal space between most items in the toolbar. | |
| 95 TOOLBAR_STANDARD_SPACING, | |
| 96 }; | |
| 97 | |
| 98 enum LayoutInset { | |
| 99 // The padding between the avatar icon and the frame border on the left, the | |
| 100 // tabstrip on the right, and the toolbar on the bottom. | |
| 101 AVATAR_ICON, | |
| 102 | |
| 103 // The padding above the top row and below the bottom row in the omnibox | |
| 104 // dropdown. | |
| 105 OMNIBOX_DROPDOWN, | |
| 106 | |
| 107 // In an omnibox dropdown row, the minimum distance between the icon and the | |
| 108 // row edge. | |
| 109 OMNIBOX_DROPDOWN_ICON, | |
| 110 | |
| 111 // In an omnibox dropdown row, the minimum distance between the text and the | |
| 112 // row edge. | |
| 113 OMNIBOX_DROPDOWN_TEXT, | |
| 114 | |
| 115 // The padding inside the tab bounds that defines the tab contents region. | |
| 116 TAB, | |
| 117 | |
| 118 // The minimum padding of the toolbar. The edge graphics have some built-in | |
| 119 // spacing, shadowing, so this accounts for that as well. | |
| 120 TOOLBAR, | |
| 121 | |
| 122 // The spacing between a ToolbarButton's image and its border. | |
| 123 TOOLBAR_BUTTON, | |
| 124 }; | |
| 125 | |
| 126 int GetLayoutConstant(LayoutConstant constant); | |
| 127 gfx::Insets GetLayoutInsets(LayoutInset inset); | |
| 128 | |
| 129 #endif // CHROME_BROWSER_UI_VIEWS_LAYOUT_CONSTANTS_H_ | |
| OLD | NEW |