OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef UI_MESSAGE_CENTER_VIEWS_NOTIFICATION_BUTTON_H_ | 5 #ifndef UI_MESSAGE_CENTER_VIEWS_NOTIFICATION_BUTTON_H_ |
6 #define UI_MESSAGE_CENTER_VIEWS_NOTIFICATION_BUTTON_H_ | 6 #define UI_MESSAGE_CENTER_VIEWS_NOTIFICATION_BUTTON_H_ |
7 | 7 |
8 #include "ui/gfx/image/image_skia.h" | 8 #include "ui/gfx/image/image_skia.h" |
9 #include "ui/views/controls/button/custom_button.h" | 9 #include "ui/views/controls/button/custom_button.h" |
10 #include "ui/views/painter.h" | 10 #include "ui/views/painter.h" |
11 #include "ui/views/view.h" | 11 #include "ui/views/view.h" |
12 | 12 |
13 namespace views { | 13 namespace views { |
14 class ImageView; | 14 class ImageView; |
15 class Label; | 15 class Label; |
16 } | 16 } |
17 | 17 |
18 namespace message_center { | 18 namespace message_center { |
19 | 19 |
20 // NotificationButtons render the action buttons of notifications. | 20 // NotificationButtons render the action buttons of notifications. |
21 class NotificationButton : public views::CustomButton { | 21 class NotificationButton : public views::CustomButton { |
22 public: | 22 public: |
23 NotificationButton(views::ButtonListener* listener); | 23 NotificationButton(views::ButtonListener* listener); |
24 virtual ~NotificationButton(); | 24 virtual ~NotificationButton(); |
25 | 25 |
26 void SetIcon(const gfx::ImageSkia& icon); | 26 void SetIcon(const gfx::ImageSkia& icon); |
27 void SetTitle(const base::string16& title); | 27 void SetTitle(const base::string16& title); |
28 | 28 |
29 // Overridden from views::View: | 29 // Overridden from views::View: |
30 virtual gfx::Size GetPreferredSize() OVERRIDE; | 30 virtual gfx::Size GetPreferredSize() const OVERRIDE; |
31 virtual int GetHeightForWidth(int width) OVERRIDE; | 31 virtual int GetHeightForWidth(int width) const OVERRIDE; |
32 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; | 32 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; |
33 virtual void OnFocus() OVERRIDE; | 33 virtual void OnFocus() OVERRIDE; |
34 virtual void OnBlur() OVERRIDE; | 34 virtual void OnBlur() OVERRIDE; |
35 | 35 |
36 // Overridden from views::CustomButton: | 36 // Overridden from views::CustomButton: |
37 virtual void StateChanged() OVERRIDE; | 37 virtual void StateChanged() OVERRIDE; |
38 | 38 |
39 private: | 39 private: |
40 views::ImageView* icon_; | 40 views::ImageView* icon_; |
41 views::Label* title_; | 41 views::Label* title_; |
42 scoped_ptr<views::Painter> focus_painter_; | 42 scoped_ptr<views::Painter> focus_painter_; |
43 | 43 |
44 DISALLOW_COPY_AND_ASSIGN(NotificationButton); | 44 DISALLOW_COPY_AND_ASSIGN(NotificationButton); |
45 }; | 45 }; |
46 | 46 |
47 } // namespace message_center | 47 } // namespace message_center |
48 | 48 |
49 #endif // UI_MESSAGE_CENTER_VIEWS_NOTIFICATION_BUTTON_H_ | 49 #endif // UI_MESSAGE_CENTER_VIEWS_NOTIFICATION_BUTTON_H_ |
OLD | NEW |