| 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 #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 #include "ui/gfx/geometry/size.h" |
| 10 | 10 |
| 11 enum LayoutConstant { | 11 enum LayoutConstant { |
| 12 // The padding on the left, right, and bottom of the avatar icon. | 12 // The padding on the left, right, and bottom of the avatar icon. |
| 13 AVATAR_ICON_PADDING, | 13 AVATAR_ICON_PADDING, |
| 14 | 14 |
| 15 // Vertical offset from top of content to the top of find bar. | |
| 16 FIND_BAR_TOOLBAR_OVERLAP, | |
| 17 | |
| 18 // The thickness of the location bar's border. | 15 // The thickness of the location bar's border. |
| 19 LOCATION_BAR_BORDER_THICKNESS, | 16 LOCATION_BAR_BORDER_THICKNESS, |
| 20 | 17 |
| 21 // The vertical padding between the edge of a location bar bubble and its | 18 // The vertical padding between the edge of a location bar bubble and its |
| 22 // contained text. | 19 // contained text. |
| 23 LOCATION_BAR_BUBBLE_FONT_VERTICAL_PADDING, | 20 LOCATION_BAR_BUBBLE_FONT_VERTICAL_PADDING, |
| 24 | 21 |
| 25 // The additional vertical padding of a bubble. | 22 // The additional vertical padding of a bubble. |
| 26 LOCATION_BAR_BUBBLE_VERTICAL_PADDING, | 23 LOCATION_BAR_BUBBLE_VERTICAL_PADDING, |
| 27 | 24 |
| 28 // The vertical inset to apply to the bounds of a location bar bubble's anchor | 25 // The vertical inset to apply to the bounds of a location bar bubble's anchor |
| 29 // view, to bring the bubble closer to the anchor. This compensates for the | 26 // view, to bring the bubble closer to the anchor. This compensates for the |
| 30 // space between the bottoms of most such views and the visible bottoms of the | 27 // space between the bottoms of most such views and the visible bottoms of the |
| 31 // images inside. | 28 // images inside. |
| 32 LOCATION_BAR_BUBBLE_ANCHOR_VERTICAL_INSET, | 29 LOCATION_BAR_BUBBLE_ANCHOR_VERTICAL_INSET, |
| 33 | 30 |
| 34 // The height to be occupied by the LocationBar. | 31 // The height to be occupied by the LocationBar. |
| 35 LOCATION_BAR_HEIGHT, | 32 LOCATION_BAR_HEIGHT, |
| 36 | 33 |
| 37 // Space between items in the location bar, as well as between items and the | 34 // Space between items in the location bar, as well as between items and the |
| 38 // edges. | 35 // edges. |
| 39 LOCATION_BAR_HORIZONTAL_PADDING, | 36 LOCATION_BAR_HORIZONTAL_PADDING, |
| 40 | 37 |
| 41 // Space between the location bar edge and contents. | 38 // Space between the location bar edge and contents. |
| 42 LOCATION_BAR_VERTICAL_PADDING, | 39 LOCATION_BAR_VERTICAL_PADDING, |
| 43 | 40 |
| 44 // The font size to use in the location bar and omnibox dropdown, in pixels. | |
| 45 OMNIBOX_FONT_PIXEL_SIZE, | |
| 46 | |
| 47 // The amount of overlap between the last tab and the new tab button. | 41 // The amount of overlap between the last tab and the new tab button. |
| 48 TABSTRIP_NEW_TAB_BUTTON_OVERLAP, | 42 TABSTRIP_NEW_TAB_BUTTON_OVERLAP, |
| 49 | 43 |
| 50 // The amount of overlap between two adjacent tabs. | 44 // The amount of overlap between two adjacent tabs. |
| 51 TABSTRIP_TAB_OVERLAP, | 45 TABSTRIP_TAB_OVERLAP, |
| 52 | 46 |
| 53 // The horizontal space between a tab's favicon and its title. | |
| 54 TAB_FAVICON_TITLE_SPACING, | |
| 55 | |
| 56 // The height of a tab, including outer strokes. In non-100% scales this is | 47 // The height of a tab, including outer strokes. In non-100% scales this is |
| 57 // slightly larger than the apparent height of the tab, as the top stroke is | 48 // slightly larger than the apparent height of the tab, as the top stroke is |
| 58 // drawn as a 1-px line flush with the bottom of the tab's topmost DIP. | 49 // drawn as a 1-px line flush with the bottom of the tab's topmost DIP. |
| 59 TAB_HEIGHT, | 50 TAB_HEIGHT, |
| 60 | 51 |
| 61 // Width available for content inside a pinned tab. | |
| 62 TAB_PINNED_CONTENT_WIDTH, | |
| 63 | |
| 64 // Padding inside toolbar button, between its border and image. | 52 // Padding inside toolbar button, between its border and image. |
| 65 TOOLBAR_BUTTON_PADDING, | 53 TOOLBAR_BUTTON_PADDING, |
| 66 | 54 |
| 67 // Additional horizontal padding between the elements in the toolbar. | 55 // Additional horizontal padding between the elements in the toolbar. |
| 68 TOOLBAR_ELEMENT_PADDING, | 56 TOOLBAR_ELEMENT_PADDING, |
| 69 | 57 |
| 70 // Padding between the right edge of the location bar and the left edge of the | |
| 71 // app menu icon when the browser actions container is not present. | |
| 72 TOOLBAR_LOCATION_BAR_RIGHT_PADDING, | |
| 73 | |
| 74 // The horizontal space between most items in the toolbar. | 58 // The horizontal space between most items in the toolbar. |
| 75 TOOLBAR_STANDARD_SPACING, | 59 TOOLBAR_STANDARD_SPACING, |
| 76 }; | 60 }; |
| 77 | 61 |
| 78 enum LayoutInset { | 62 enum LayoutInset { |
| 79 // The padding inside the tab bounds that defines the tab contents region. | 63 // The padding inside the tab bounds that defines the tab contents region. |
| 80 TAB, | 64 TAB, |
| 81 }; | 65 }; |
| 82 | 66 |
| 83 enum LayoutSize { | 67 enum LayoutSize { |
| 84 // The visible size of the new tab button; does not include any Fitts' Law | 68 // The visible size of the new tab button; does not include any Fitts' Law |
| 85 // extensions. | 69 // extensions. |
| 86 NEW_TAB_BUTTON, | 70 NEW_TAB_BUTTON, |
| 87 }; | 71 }; |
| 88 | 72 |
| 89 int GetLayoutConstant(LayoutConstant constant); | 73 int GetLayoutConstant(LayoutConstant constant); |
| 90 gfx::Insets GetLayoutInsets(LayoutInset inset); | 74 gfx::Insets GetLayoutInsets(LayoutInset inset); |
| 91 gfx::Size GetLayoutSize(LayoutSize size); | 75 gfx::Size GetLayoutSize(LayoutSize size); |
| 92 | 76 |
| 93 #endif // CHROME_BROWSER_UI_LAYOUT_CONSTANTS_H_ | 77 #endif // CHROME_BROWSER_UI_LAYOUT_CONSTANTS_H_ |
| OLD | NEW |