Chromium Code Reviews| Index: ui/message_center/views/notification_view.h |
| diff --git a/ui/message_center/views/notification_view.h b/ui/message_center/views/notification_view.h |
| index 6d54895ac8e0e439ef2553ec560089c97c5037bb..6ce79c2870ce0922674f78902fe96b75132a3ac4 100644 |
| --- a/ui/message_center/views/notification_view.h |
| +++ b/ui/message_center/views/notification_view.h |
| @@ -11,6 +11,8 @@ |
| #include "base/macros.h" |
| #include "ui/message_center/message_center_export.h" |
| #include "ui/message_center/views/message_view.h" |
| +#include "ui/views/controls/button/button.h" |
| +#include "ui/views/controls/button/image_button.h" |
| #include "ui/views/view_targeter_delegate.h" |
| namespace views { |
| @@ -29,6 +31,7 @@ class ProportionalImageView; |
| // returned by the Create() factory method below. |
| class MESSAGE_CENTER_EXPORT NotificationView |
| : public MessageView, |
| + public views::ButtonListener, |
| public views::ViewTargeterDelegate { |
| public: |
| NotificationView(MessageCenterController* controller, |
| @@ -46,6 +49,12 @@ class MESSAGE_CENTER_EXPORT NotificationView |
| // Overridden from MessageView: |
| void UpdateWithNotification(const Notification& notification) override; |
| void ButtonPressed(views::Button* sender, const ui::Event& event) override; |
| + bool IsCloseButtonFocused() const override; |
|
yoshiki
2016/12/06 05:28:27
Please move this line to a separated block since t
yhanada
2016/12/06 06:41:26
These methods are actually from MessageView.
|
| + void RequestFocusOnCloseButton() override; |
| + bool IsPinned() const override; |
| + |
| + protected: |
| + views::ImageButton* close_button() { return close_button_.get(); } |
| private: |
| FRIEND_TEST_ALL_PREFIXES(NotificationViewTest, CreateOrUpdateTest); |
| @@ -75,6 +84,7 @@ class MESSAGE_CENTER_EXPORT NotificationView |
| void CreateOrUpdateIconView(const Notification& notification); |
| void CreateOrUpdateImageView(const Notification& notification); |
| void CreateOrUpdateActionButtonViews(const Notification& notification); |
| + void CreateOrUpdateCloseButtonView(const Notification& notification); |
| int GetMessageLineLimit(int title_lines, int width) const; |
| int GetMessageHeight(int width, int limit) const; |
| @@ -102,6 +112,7 @@ class MESSAGE_CENTER_EXPORT NotificationView |
| views::ProgressBar* progress_bar_view_ = nullptr; |
| std::vector<NotificationButton*> action_buttons_; |
| std::vector<views::View*> separators_; |
| + std::unique_ptr<views::ImageButton> close_button_ = nullptr; |
| DISALLOW_COPY_AND_ASSIGN(NotificationView); |
| }; |