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

Side by Side Diff: chrome/browser/ui/views/tabs/tab.cc

Issue 2555623002: Last round of cleaning up MD layout constants. (Closed)
Patch Set: Created 4 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #include "chrome/browser/ui/views/tabs/tab.h" 5 #include "chrome/browser/ui/views/tabs/tab.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <limits> 8 #include <limits>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 721 matching lines...) Expand 10 before | Expand all | Expand 10 after
732 GetMinimumInactiveSize().height()); 732 GetMinimumInactiveSize().height());
733 } 733 }
734 734
735 // static 735 // static
736 int Tab::GetTouchWidth() { 736 int Tab::GetTouchWidth() {
737 return kTouchWidth; 737 return kTouchWidth;
738 } 738 }
739 739
740 // static 740 // static
741 int Tab::GetPinnedWidth() { 741 int Tab::GetPinnedWidth() {
742 return GetMinimumInactiveSize().width() + 742 const int kTabPinnedContentWidth = 23;
743 GetLayoutConstant(TAB_PINNED_CONTENT_WIDTH); 743 return GetMinimumInactiveSize().width() + kTabPinnedContentWidth;
744 } 744 }
745 745
746 // static 746 // static
747 int Tab::GetImmersiveHeight() { 747 int Tab::GetImmersiveHeight() {
748 return kImmersiveTabHeight; 748 return kImmersiveTabHeight;
749 } 749 }
750 750
751 // static 751 // static
752 float Tab::GetInverseDiagonalSlope() { 752 float Tab::GetInverseDiagonalSlope() {
753 // This is computed from the border path as follows: 753 // This is computed from the border path as follows:
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
912 image_size.width(), 912 image_size.width(),
913 image_size.height()); 913 image_size.height());
914 MaybeAdjustLeftForPinnedTab(&bounds); 914 MaybeAdjustLeftForPinnedTab(&bounds);
915 alert_indicator_button_->SetBoundsRect(bounds); 915 alert_indicator_button_->SetBoundsRect(bounds);
916 } 916 }
917 alert_indicator_button_->SetVisible(showing_alert_indicator_); 917 alert_indicator_button_->SetVisible(showing_alert_indicator_);
918 918
919 // Size the title to fill the remaining width and use all available height. 919 // Size the title to fill the remaining width and use all available height.
920 const bool show_title = ShouldRenderAsNormalTab(); 920 const bool show_title = ShouldRenderAsNormalTab();
921 if (show_title) { 921 if (show_title) {
922 const int title_spacing = GetLayoutConstant(TAB_FAVICON_TITLE_SPACING); 922 const int kTitleSpacing = 6;
923 int title_left = showing_icon_ ? 923 int title_left =
924 (favicon_bounds_.right() + title_spacing) : start; 924 showing_icon_ ? (favicon_bounds_.right() + kTitleSpacing) : start;
925 int title_width = lb.right() - title_left; 925 int title_width = lb.right() - title_left;
926 if (showing_alert_indicator_) { 926 if (showing_alert_indicator_) {
927 title_width = 927 title_width =
928 alert_indicator_button_->x() - kAfterTitleSpacing - title_left; 928 alert_indicator_button_->x() - kAfterTitleSpacing - title_left;
929 } else if (showing_close_button_) { 929 } else if (showing_close_button_) {
930 // Allow the title to overlay the close button's empty border padding. 930 // Allow the title to overlay the close button's empty border padding.
931 title_width = close_button_->x() + close_button_->GetInsets().left() - 931 title_width = close_button_->x() + close_button_->GetInsets().left() -
932 kAfterTitleSpacing - title_left; 932 kAfterTitleSpacing - title_left;
933 } 933 }
934 // The Label will automatically center the font's cap height within the 934 // The Label will automatically center the font's cap height within the
(...skipping 642 matching lines...) Expand 10 before | Expand all | Expand 10 after
1577 SchedulePaintInRect(bounds); 1577 SchedulePaintInRect(bounds);
1578 } 1578 }
1579 1579
1580 gfx::Rect Tab::GetImmersiveBarRect() const { 1580 gfx::Rect Tab::GetImmersiveBarRect() const {
1581 // The main bar is as wide as the normal tab's horizontal top line. 1581 // The main bar is as wide as the normal tab's horizontal top line.
1582 gfx::Rect contents = GetContentsBounds(); 1582 gfx::Rect contents = GetContentsBounds();
1583 contents.set_y(0); 1583 contents.set_y(0);
1584 contents.set_height(kImmersiveBarHeight); 1584 contents.set_height(kImmersiveBarHeight);
1585 return contents; 1585 return contents;
1586 } 1586 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698