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_NOTIFICATION_DELEGATE_H_ | 5 #ifndef UI_MESSAGE_CENTER_NOTIFICATION_DELEGATE_H_ |
6 #define UI_MESSAGE_CENTER_NOTIFICATION_DELEGATE_H_ | 6 #define UI_MESSAGE_CENTER_NOTIFICATION_DELEGATE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 protected: | 69 protected: |
70 virtual ~HandleNotificationClickedDelegate(); | 70 virtual ~HandleNotificationClickedDelegate(); |
71 | 71 |
72 private: | 72 private: |
73 std::string id_; | 73 std::string id_; |
74 base::Closure closure_; | 74 base::Closure closure_; |
75 | 75 |
76 DISALLOW_COPY_AND_ASSIGN(HandleNotificationClickedDelegate); | 76 DISALLOW_COPY_AND_ASSIGN(HandleNotificationClickedDelegate); |
77 }; | 77 }; |
78 | 78 |
| 79 // A notification delegate which invokes a callback when a notification button |
| 80 // has been clicked. |
| 81 class MESSAGE_CENTER_EXPORT HandleNotificationButtonClickDelegate |
| 82 : public NotificationDelegate { |
| 83 public: |
| 84 typedef base::Callback<void(int)> ButtonClickCallback; |
| 85 |
| 86 explicit HandleNotificationButtonClickDelegate( |
| 87 const ButtonClickCallback& button_callback); |
| 88 |
| 89 // message_center::NotificationDelegate overrides: |
| 90 virtual void Display() OVERRIDE; |
| 91 virtual void Error() OVERRIDE; |
| 92 virtual void Close(bool by_user) OVERRIDE; |
| 93 virtual void Click() OVERRIDE; |
| 94 virtual void ButtonClick(int button_index) OVERRIDE; |
| 95 |
| 96 protected: |
| 97 virtual ~HandleNotificationButtonClickDelegate(); |
| 98 |
| 99 private: |
| 100 ButtonClickCallback button_callback_; |
| 101 |
| 102 DISALLOW_COPY_AND_ASSIGN(HandleNotificationButtonClickDelegate); |
| 103 }; |
| 104 |
79 } // namespace message_center | 105 } // namespace message_center |
80 | 106 |
81 #endif // UI_MESSAGE_CENTER_NOTIFICATION_DELEGATE_H_ | 107 #endif // UI_MESSAGE_CENTER_NOTIFICATION_DELEGATE_H_ |
OLD | NEW |