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

Unified Diff: chrome/browser/ui/layout_constants.cc

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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/layout_constants.h ('k') | chrome/browser/ui/views/frame/glass_browser_frame_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/layout_constants.cc
diff --git a/chrome/browser/ui/layout_constants.cc b/chrome/browser/ui/layout_constants.cc
index 3a4a34a2c5a8a196ce140b9e5e587b8d89487b0d..cccaeb489097d7a95816bbdd423cee063c88fc37 100644
--- a/chrome/browser/ui/layout_constants.cc
+++ b/chrome/browser/ui/layout_constants.cc
@@ -17,12 +17,11 @@ int GetLayoutConstant(LayoutConstant constant) {
const int kLocationBarHeight[] = {27, 28, 32};
const int kLocationBarHorizontalPadding[] = {3, 6, 6};
const int kLocationBarVerticalPadding[] = {2, 2, 2};
- const int kNewTabButtonWidth[] = {34, 36, 36};
const int kOmniboxDropdownBorderInterior[] = {6, 0, 0};
const int kOmniboxFontPixelSize[] = {16, 14, 14};
const int kTabCloseButtonTrailingPaddingOverlap[] = {2, 0, 0};
const int kTabFaviconTitleSpacing[] = {4, 6, 6};
- const int kTabMaximumTitleWidth[] = {175, 171, 171};
+ const int kTabHeight[] = {29, 29, 29};
const int kTabPinnedContentWidth[] = {25, 23, 23};
#if defined(OS_MACOSX)
const int kTabTopExclusionHeight[] = {0, 0, 0};
@@ -60,8 +59,6 @@ int GetLayoutConstant(LayoutConstant constant) {
return kLocationBarHorizontalPadding[mode];
case LOCATION_BAR_VERTICAL_PADDING:
return kLocationBarVerticalPadding[mode];
- case NEW_TAB_BUTTON_WIDTH:
- return kNewTabButtonWidth[mode];
case OMNIBOX_DROPDOWN_BORDER_INTERIOR:
return kOmniboxDropdownBorderInterior[mode];
case OMNIBOX_FONT_PIXEL_SIZE:
@@ -76,8 +73,8 @@ int GetLayoutConstant(LayoutConstant constant) {
return kTabCloseButtonTrailingPaddingOverlap[mode];
case TAB_FAVICON_TITLE_SPACING:
return kTabFaviconTitleSpacing[mode];
- case TAB_MAXIMUM_TITLE_WIDTH:
- return kTabMaximumTitleWidth[mode];
+ case TAB_HEIGHT:
+ return kTabHeight[mode];
case TAB_PINNED_CONTENT_WIDTH:
return kTabPinnedContentWidth[mode];
case TAB_TOP_EXCLUSION_HEIGHT:
@@ -116,10 +113,9 @@ gfx::Insets GetLayoutInsets(LayoutInset inset) {
const int mode = ui::MaterialDesignController::GetMode();
switch (inset) {
- case AVATAR_ICON: {
+ case AVATAR_ICON:
return gfx::Insets(0, kAvatarLeftPadding[mode],
kAvatarBottomPadding[mode], kAvatarRightPadding[mode]);
- }
case OMNIBOX_DROPDOWN: {
const int padding = kOmniboxDropdownPadding[mode];
return gfx::Insets(padding, 0, padding, 0);
@@ -147,3 +143,16 @@ gfx::Insets GetLayoutInsets(LayoutInset inset) {
NOTREACHED();
return gfx::Insets();
}
+
+gfx::Size GetLayoutSize(LayoutSize size) {
+ const int kNewTabButtonWidth[] = {34, 36, 36};
+ const int kNewTabButtonHeight[] = {18, 18, 18};
+
+ const int mode = ui::MaterialDesignController::GetMode();
+ switch (size) {
+ case NEW_TAB_BUTTON:
+ return gfx::Size(kNewTabButtonWidth[mode], kNewTabButtonHeight[mode]);
+ }
+ NOTREACHED();
+ return gfx::Size();
+}
« no previous file with comments | « chrome/browser/ui/layout_constants.h ('k') | chrome/browser/ui/views/frame/glass_browser_frame_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698