Index: ui/arc/notification/arc_notification_item.cc |
diff --git a/ui/arc/notification/arc_notification_item.cc b/ui/arc/notification/arc_notification_item.cc |
index 05e67ab07eecbe4533b59515abddc9a4076e4592..bed1b848612d84dd8251bf5c97a54ae1ebd73f3c 100644 |
--- a/ui/arc/notification/arc_notification_item.cc |
+++ b/ui/arc/notification/arc_notification_item.cc |
@@ -60,6 +60,11 @@ class ArcNotificationDelegate : public message_center::NotificationDelegate { |
item_->Click(); |
} |
+ void ButtonClick(int button_index) override { |
+ if (item_) |
+ item_->ButtonClick(button_index); |
+ } |
+ |
private: |
// The destructor is private since this class is ref-counted. |
~ArcNotificationDelegate() override {} |
@@ -125,6 +130,11 @@ void ArcNotificationItem::UpdateWithArcNotificationData( |
DCHECK(0 <= data.type && data.type <= ARC_NOTIFICATION_TYPE_MAX) |
<< "Unsupported notification type: " << data.type; |
+ for (size_t i = 0; i < data.buttons.size(); i++) { |
+ rich_data.buttons.push_back(message_center::ButtonInfo( |
+ base::UTF8ToUTF16(data.buttons.at(i)->label.get()))); |
+ } |
+ |
// The identifier of the notifier, which is used to distinguish the notifiers |
// in the message center. |
message_center::NotifierId notifier_id( |
@@ -179,6 +189,11 @@ void ArcNotificationItem::Click() { |
manager_->SendNotificationClickedOnChrome(notification_key_); |
} |
+void ArcNotificationItem::ButtonClick(int button_index) { |
+ manager_->SendNotificationButtonClickedOnChrome( |
+ notification_key_, button_index); |
+} |
+ |
void ArcNotificationItem::OnImageDecoded(const SkBitmap& bitmap) { |
DCHECK(thread_checker_.CalledOnValidThread()); |