Avoid repeatedly deriving fonts in the LabelButton ctor.
commit753f06ff55b91b8ff39352e8bf87cbbbd2d695f4
authormsw <msw@chromium.org>
Tue, 16 Sep 2014 01:02:20 +0000 (15 18:02 -0700)
committerCommit bot <commit-bot@chromium.org>
Tue, 16 Sep 2014 01:05:38 +0000 (16 01:05 +0000)
treef75f0526fdc68b7de0273e7067228432de550b85
parent35e3a9c7061205db58f57182f5ba5eb87be0f355
Avoid repeatedly deriving fonts in the LabelButton ctor.

Create LazyInstances for the default LabelButton FontLists.
Avoid creating/deriving default fonts for each new button.
(the bookmark bar can create unbounded button instances)
(repeated derivation is slow and exhausts GDI handles)

BUG=411716
TEST=Profiles with tons of bookmarks do not crash.
R=sky@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#294955}
ui/views/controls/button/label_button.cc