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

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

Issue 867003002: Cache gfx::RenderText instances in views::Label. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: do not overuse the memory Created 5 years, 10 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
« no previous file with comments | « no previous file | ui/app_list/views/app_list_item_view.h » ('j') | ui/gfx/render_text.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 29841163c87a34db0b811cabbf7030e9156b44aa..353542ad90ade0f9be07f50855e8a9b55793fa49 100644
--- a/chrome/browser/ui/views/tabs/tab.cc
+++ b/chrome/browser/ui/views/tabs/tab.cc
@@ -439,6 +439,7 @@ Tab::Tab(TabController* controller)
title_->SetElideBehavior(gfx::FADE_TAIL);
title_->SetHandlesTooltips(false);
title_->SetAutoColorReadabilityEnabled(false);
+ title_->set_collapse_when_hidden(true);
title_->SetText(CoreTabHelper::GetDefaultTitle());
AddChildView(title_);
@@ -812,7 +813,7 @@ void Tab::Layout() {
kViewSpacing - title_left;
}
gfx::Rect rect(title_left, lb.y(), std::max(title_width, 0), lb.height());
- const int title_height = title_->GetPreferredSize().height();
+ const int title_height = title_->GetHeightForWidth(title_width);
if (title_height > rect.height()) {
rect.set_y(lb.y() - (title_height - rect.height()) / 2);
rect.set_height(title_height);
« no previous file with comments | « no previous file | ui/app_list/views/app_list_item_view.h » ('j') | ui/gfx/render_text.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698