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

Unified Diff: ui/views/controls/tabbed_pane/tabbed_pane.cc

Issue 137533011: Clean-up: Avoids unnecessary font list creation in views::Tab. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/tabbed_pane/tabbed_pane.cc
diff --git a/ui/views/controls/tabbed_pane/tabbed_pane.cc b/ui/views/controls/tabbed_pane/tabbed_pane.cc
index ede85d514cb5af1984fcb39a89599b5e2f7a8ea4..65cb885692794abfa51877ee7b30b81249b546fc 100644
--- a/ui/views/controls/tabbed_pane/tabbed_pane.cc
+++ b/ui/views/controls/tabbed_pane/tabbed_pane.cc
@@ -6,6 +6,7 @@
#include "base/logging.h"
#include "ui/base/accessibility/accessible_view_state.h"
+#include "ui/base/resource/resource_bundle.h"
#include "ui/events/keycodes/keyboard_codes.h"
#include "ui/gfx/canvas.h"
#include "ui/gfx/font_list.h"
@@ -159,20 +160,19 @@ void Tab::SetState(TabState tab_state) {
return;
tab_state_ = tab_state;
+ ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
switch (tab_state) {
case TAB_INACTIVE:
title_->SetEnabledColor(kTabTitleColor_Inactive);
- title_->SetFontList(gfx::FontList());
+ title_->SetFontList(rb.GetFontList(ui::ResourceBundle::BaseFont));
sadrul 2014/01/16 14:29:41 Just so I understand: this (and the change in line
Yuki 2014/01/16 14:53:27 My understanding is that 1. When Tab::SetState(TAB
sadrul 2014/01/16 15:17:31 I was not asking whether it was necessary to call
Yuki 2014/01/16 15:31:02 Yes, they're equivalent. The default instance of
break;
case TAB_ACTIVE:
title_->SetEnabledColor(kTabTitleColor_Active);
- title_->SetFontList(
- gfx::FontList().DeriveFontListWithSizeDeltaAndStyle(
- 0, gfx::Font::BOLD));
+ title_->SetFontList(rb.GetFontList(ui::ResourceBundle::BoldFont));
break;
case TAB_HOVERED:
title_->SetEnabledColor(kTabTitleColor_Hovered);
- title_->SetFontList(gfx::FontList());
+ title_->SetFontList(rb.GetFontList(ui::ResourceBundle::BaseFont));
break;
}
SchedulePaint();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698