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

Unified Diff: chrome/browser/ui/views/tabs/tab.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
Index: chrome/browser/ui/views/tabs/tab.cc
diff --git a/chrome/browser/ui/views/tabs/tab.cc b/chrome/browser/ui/views/tabs/tab.cc
index 87250a99a5f6823cbc614d8db28bf3abeb6b1678..2005cac04e689667e759b4d742ed6162f556fbb8 100644
--- a/chrome/browser/ui/views/tabs/tab.cc
+++ b/chrome/browser/ui/views/tabs/tab.cc
@@ -651,19 +651,9 @@ int Tab::GetWidthOfLargestSelectableRegion() const {
return std::min(indicator_left, close_button_left);
}
+// static
gfx::Size Tab::GetMinimumInactiveSize() {
- int height;
- if (ui::MaterialDesignController::IsModeMaterial()) {
- const int kTabHeight = 29;
- height = kTabHeight;
- } else {
- // Since we use images, the real minimum height of the image is
- // defined most accurately by the height of the end cap images.
- InitTabResources();
- height = active_images_.image_l->height();
- }
-
- return gfx::Size(GetLayoutInsets(TAB).width(), height);
+ return gfx::Size(GetLayoutInsets(TAB).width(), GetLayoutConstant(TAB_HEIGHT));
}
// static
@@ -675,11 +665,9 @@ gfx::Size Tab::GetMinimumActiveSize() {
// static
gfx::Size Tab::GetStandardSize() {
- gfx::Size standard_size = GetMinimumInactiveSize();
- const int title_spacing = GetLayoutConstant(TAB_FAVICON_TITLE_SPACING);
- const int title_width = GetLayoutConstant(TAB_MAXIMUM_TITLE_WIDTH);
- standard_size.Enlarge(title_spacing + title_width, 0);
- return standard_size;
+ const int kNetTabWidth = 193;
+ return gfx::Size(kNetTabWidth + GetLayoutConstant(TABSTRIP_TAB_OVERLAP),
+ GetMinimumInactiveSize().height());
}
// static
« no previous file with comments | « chrome/browser/ui/views/frame/opaque_browser_frame_view_layout.cc ('k') | chrome/browser/ui/views/tabs/tab_strip.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698