Clean-up: Avoids unnecessary font list creation in views::Tab.

There is no need to derive(create) a new font list in views::Tab.  Uses BaseFont and BoldFont.

TEST=none

Review URL: https://codereview.chromium.org/137533011

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@245250 0039d316-1c4b-4281-b951-d872f2087c98
parent 6ddbd914
......@@ -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));
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();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment