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

Unified Diff: chrome/browser/views/tabs/tab_renderer.cc

Issue 7344: Convert GetPreferredSize from:... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 12 years, 2 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/views/tabs/tab_renderer.cc
===================================================================
--- chrome/browser/views/tabs/tab_renderer.cc (revision 3391)
+++ chrome/browser/views/tabs/tab_renderer.cc (working copy)
@@ -330,7 +330,7 @@
}
// static
-gfx::Size TabRenderer::GetMinimumSize() {
+gfx::Size TabRenderer::GetMinimumUnselectedSize() {
InitResources();
gfx::Size minimum_size;
@@ -343,14 +343,14 @@
// static
gfx::Size TabRenderer::GetMinimumSelectedSize() {
- gfx::Size minimum_size = GetMinimumSize();
+ gfx::Size minimum_size = GetMinimumUnselectedSize();
minimum_size.set_width(kLeftPadding + kFaviconSize + kRightPadding);
return minimum_size;
}
// static
gfx::Size TabRenderer::GetStandardSize() {
- gfx::Size standard_size = GetMinimumSize();
+ gfx::Size standard_size = GetMinimumUnselectedSize();
standard_size.set_width(
standard_size.width() + kFavIconTitleSpacing + kStandardTitleWidth);
return standard_size;
@@ -369,7 +369,7 @@
void TabRenderer::Paint(ChromeCanvas* canvas) {
// Don't paint if we're narrower than we can render correctly. (This should
// only happen during animations).
- if (width() < GetMinimumSize().width())
+ if (width() < GetMinimumUnselectedSize().width())
return;
// See if the model changes whether the icons should be painted.
@@ -492,7 +492,7 @@
// If the user has big fonts, the title will appear rendered too far down on
// the y-axis if we use the regular top padding, so we need to adjust it so
// that the text appears centered.
- gfx::Size minimum_size = GetMinimumSize();
+ gfx::Size minimum_size = GetMinimumUnselectedSize();
int text_height = title_top + title_font_height + kBottomPadding;
if (text_height > minimum_size.height())
title_top -= (text_height - minimum_size.height()) / 2;
@@ -635,9 +635,8 @@
}
int TabRenderer::IconCapacity() const {
- if (height() < GetMinimumSize().height()) {
+ if (height() < GetMinimumUnselectedSize().height())
return 0;
- }
return (width() - kLeftPadding - kRightPadding) / kFaviconSize;
}

Powered by Google App Engine
This is Rietveld 408576698