1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef UI_MESSAGE_CENTER_VIEWS_NOTIFICATION_BUTTON_H_
6 #define UI_MESSAGE_CENTER_VIEWS_NOTIFICATION_BUTTON_H_
8 #include "ui/gfx/image/image_skia.h"
9 #include "ui/views/controls/button/custom_button.h"
10 #include "ui/views/painter.h"
11 #include "ui/views/view.h"
18 namespace message_center
{
20 // NotificationButtons render the action buttons of notifications.
21 class NotificationButton
: public views::CustomButton
{
23 NotificationButton(views::ButtonListener
* listener
);
24 ~NotificationButton() override
;
26 void SetIcon(const gfx::ImageSkia
& icon
);
27 void SetTitle(const base::string16
& title
);
29 // Overridden from views::View:
30 gfx::Size
GetPreferredSize() const override
;
31 int GetHeightForWidth(int width
) const override
;
32 void OnPaint(gfx::Canvas
* canvas
) override
;
33 void OnFocus() override
;
34 void OnBlur() override
;
35 void ViewHierarchyChanged(
36 const ViewHierarchyChangedDetails
& details
) override
;
38 // Overridden from views::CustomButton:
39 void StateChanged() override
;
42 views::ImageView
* icon_
;
44 scoped_ptr
<views::Painter
> focus_painter_
;
46 DISALLOW_COPY_AND_ASSIGN(NotificationButton
);
49 } // namespace message_center
51 #endif // UI_MESSAGE_CENTER_VIEWS_NOTIFICATION_BUTTON_H_