diff options
author | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-11-22 22:24:58 +0000 |
---|---|---|
committer | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-11-22 22:24:58 +0000 |
commit | c60e4e818a67147a73de20958c995e215aedc00b (patch) | |
tree | 797bb9a3841f031cf96e24745835a071ffa1e942 /ui/message_center | |
parent | 3e5fed16463238bb2f4792e0112121243e3fb9d9 (diff) | |
download | chromium_src-c60e4e818a67147a73de20958c995e215aedc00b.zip chromium_src-c60e4e818a67147a73de20958c995e215aedc00b.tar.gz chromium_src-c60e4e818a67147a73de20958c995e215aedc00b.tar.bz2 |
Remove unnecessary Border subclasses where we can achieve the same functionality
without subclassing.
BUG=none
TEST=none
R=sky@chromium.org
Review URL: https://codereview.chromium.org/81833007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@236844 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/message_center')
-rw-r--r-- | ui/message_center/views/notifier_settings_view.cc | 49 |
1 files changed, 15 insertions, 34 deletions
diff --git a/ui/message_center/views/notifier_settings_view.cc b/ui/message_center/views/notifier_settings_view.cc index 7518761..47af260 100644 --- a/ui/message_center/views/notifier_settings_view.cc +++ b/ui/message_center/views/notifier_settings_view.cc @@ -189,39 +189,6 @@ bool EntryView::OnKeyReleased(const ui::KeyEvent& event) { } // namespace -// NotifierGroupMenuButtonBorder /////////////////////////////////////////////// -//////////////////////////////////////////////////////////////////////////////// -class NotifierGroupMenuButtonBorder : public views::TextButtonDefaultBorder { - public: - NotifierGroupMenuButtonBorder(); - - private: - virtual ~NotifierGroupMenuButtonBorder(); -}; - -NotifierGroupMenuButtonBorder::NotifierGroupMenuButtonBorder() - : views::TextButtonDefaultBorder() { - ui::ResourceBundle& rb = ResourceBundle::GetSharedInstance(); - - gfx::Insets insets(kButtonPainterInsets, - kButtonPainterInsets, - kButtonPainterInsets, - kButtonPainterInsets); - - set_normal_painter(views::Painter::CreateImagePainter( - *rb.GetImageSkiaNamed(IDR_BUTTON_NORMAL), insets)); - set_hot_painter(views::Painter::CreateImagePainter( - *rb.GetImageSkiaNamed(IDR_BUTTON_HOVER), insets)); - set_pushed_painter(views::Painter::CreateImagePainter( - *rb.GetImageSkiaNamed(IDR_BUTTON_PRESSED), insets)); - - SetInsets(gfx::Insets(kMenuButtonVerticalPadding, - kMenuButtonLeftPadding, - kMenuButtonVerticalPadding, - kMenuButtonRightPadding)); -} - -NotifierGroupMenuButtonBorder::~NotifierGroupMenuButtonBorder() {} // NotifierGroupMenuModel ----------------------------------------------------- @@ -596,7 +563,21 @@ void NotifierSettingsView::UpdateContentsView( active_group.name : active_group.login_info; notifier_group_selector_ = new views::MenuButton(NULL, notifier_group_text, this, true); - notifier_group_selector_->set_border(new NotifierGroupMenuButtonBorder); + scoped_ptr<views::TextButtonDefaultBorder> selector_border( + new views::TextButtonDefaultBorder()); + ui::ResourceBundle* rb = &ResourceBundle::GetSharedInstance(); + gfx::Insets painter_insets(kButtonPainterInsets, kButtonPainterInsets, + kButtonPainterInsets, kButtonPainterInsets); + selector_border->set_normal_painter(views::Painter::CreateImagePainter( + *rb->GetImageSkiaNamed(IDR_BUTTON_NORMAL), painter_insets)); + selector_border->set_hot_painter(views::Painter::CreateImagePainter( + *rb->GetImageSkiaNamed(IDR_BUTTON_HOVER), painter_insets)); + selector_border->set_pushed_painter(views::Painter::CreateImagePainter( + *rb->GetImageSkiaNamed(IDR_BUTTON_PRESSED), painter_insets)); + selector_border->SetInsets(gfx::Insets( + kMenuButtonVerticalPadding, kMenuButtonLeftPadding, + kMenuButtonVerticalPadding, kMenuButtonRightPadding)); + notifier_group_selector_->set_border(selector_border.release()); notifier_group_selector_->set_focus_border(NULL); notifier_group_selector_->set_animate_on_state_change(false); notifier_group_selector_->set_focusable(true); |