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 694f41bdde7867f0f7218a3c1484f85e7bc4c4a8..48d3868857a504464c5a1314d9b62be854e2be6c 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(ArcNotificationType_IsValidValue(data.type)) |
<< "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()); |