diff options
author | yukishiino@chromium.org <yukishiino@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-01-16 18:09:16 +0000 |
---|---|---|
committer | yukishiino@chromium.org <yukishiino@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-01-16 18:09:16 +0000 |
commit | a2a083997562f39a5a50f135f5eb430fd786766a (patch) | |
tree | 0ddd74ef8d34e2a957b474e07a2c8a41a1094f47 /ui/views/controls/tabbed_pane/tabbed_pane.cc | |
parent | 6ddbd91432cf16b4ad6bce74c65f822b068cdb8e (diff) | |
download | chromium_src-a2a083997562f39a5a50f135f5eb430fd786766a.zip chromium_src-a2a083997562f39a5a50f135f5eb430fd786766a.tar.gz chromium_src-a2a083997562f39a5a50f135f5eb430fd786766a.tar.bz2 |
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
Diffstat (limited to 'ui/views/controls/tabbed_pane/tabbed_pane.cc')
-rw-r--r-- | ui/views/controls/tabbed_pane/tabbed_pane.cc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/ui/views/controls/tabbed_pane/tabbed_pane.cc b/ui/views/controls/tabbed_pane/tabbed_pane.cc index ede85d5..65cb885 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)); 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(); |