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

Unified Diff: chrome/browser/ui/views/tabs/tab.cc

Issue 2360803002: Remove some pre-MD code from toolbar/tabstrip/frame. (Closed)
Patch Set: couple more Created 4 years, 3 months 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 6d1a36082e0b092d93e042ace7f7f422548a91c3..4502df7fede3c169693040a5e0ab1623459b8903 100644
--- a/chrome/browser/ui/views/tabs/tab.cc
+++ b/chrome/browser/ui/views/tabs/tab.cc
@@ -378,7 +378,7 @@ gfx::Path GetBorderPath(float scale,
#endif
SkScalar left = kTabInset;
- SkScalar top = GetLayoutConstant(TAB_TOP_EXCLUSION_HEIGHT);
+ SkScalar top = SkIntToScalar(0);
Peter Kasting 2016/09/22 23:27:25 Saga of code review: I was gonna tell you to just
Evan Stade 2016/09/23 00:31:08 yes to cl creep. I think I removed the block below
SkScalar right = SkIntToScalar(size.width()) - kTabInset;
SkScalar bottom = SkIntToScalar(size.height());
@@ -388,21 +388,15 @@ gfx::Path GetBorderPath(float scale,
// Left end cap.
path.lineTo(left + kTabBottomCurveWidth, bottom - kTabBottomCurveWidth);
path.lineTo(left + kTabCapWidth - kTabTopCurveWidth,
- top + kTabTopCurveWidth);
+ top + kTabTopCurveWidth);
path.lineTo(left + kTabCapWidth, top);
- // Extend over the top shadow area if we have one and the caller wants it.
- if (top > 0 && extend_to_top) {
- path.lineTo(left + kTabCapWidth, 0);
- path.lineTo(right - kTabCapWidth, 0);
- }
-
// Connect to the right cap.
path.lineTo(right - kTabCapWidth, top);
// Right end cap.
path.lineTo(right - kTabCapWidth + kTabTopCurveWidth,
- top + kTabTopCurveWidth);
+ top + kTabTopCurveWidth);
path.lineTo(right - kTabBottomCurveWidth, bottom - kTabBottomCurveWidth);
path.lineTo(right, bottom);
@@ -890,13 +884,7 @@ int Tab::GetImmersiveHeight() {
// static
int Tab::GetYInsetForActiveTabBackground() {
- // The computed value here is strangely less than the height of the area atop
- // the tab that doesn't get a background painted; otherwise, we could compute
- // the value by simply using GetLayoutInsets(TAB).top(). My suspicion is that
- // originally there was some sort of off-by-one error in how this background
- // was painted, and theme authors compensated; now we're stuck perpetuating it
- // as a result.
- return GetLayoutConstant(TAB_TOP_EXCLUSION_HEIGHT) + 1;
+ return GetLayoutInsets(TAB).top();
Peter Kasting 2016/09/22 23:27:25 Nit: ? // TODO(estade): Just nuke this function
Evan Stade 2016/09/23 00:31:08 todone
}
// static
@@ -1041,8 +1029,7 @@ void Tab::Layout() {
const gfx::Size close_button_size(close_button_->GetPreferredSize());
const int top = lb.y() + (lb.height() - close_button_size.height() + 1) / 2;
const int left = kAfterTitleSpacing;
- const int close_button_end = lb.right() +
- GetLayoutConstant(TAB_CLOSE_BUTTON_TRAILING_PADDING_OVERLAP);
+ const int close_button_end = lb.right();
close_button_->SetPosition(
gfx::Point(close_button_end - close_button_size.width() - left, 0));
const int bottom = height() - close_button_size.height() - top;
@@ -1375,8 +1362,7 @@ void Tab::PaintInactiveTabBackground(gfx::Canvas* canvas,
// only providing a custom frame image, |has_custom_image| will be true, but
// we should use the |background_offset_| here.
const ui::ThemeProvider* tp = GetThemeProvider();
- const int y_offset = tp->HasCustomImage(fill_id) ?
- -GetLayoutConstant(TAB_TOP_EXCLUSION_HEIGHT) : background_offset_.y();
+ const int y_offset = tp->HasCustomImage(fill_id) ? 0 : background_offset_.y();
// We only cache the image when it's the default image and we're not hovered,
// to avoid caching a background image that isn't the same for all tabs.

Powered by Google App Engine
This is Rietveld 408576698