Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(580)

Unified Diff: content/browser/notifications/notification_database_data_conversions.cc

Issue 1267673003: Plumb Blink notification actions to button UI on desktop (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Notifications database integration Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/notifications/notification_database_data_conversions.cc
diff --git a/content/browser/notifications/notification_database_data_conversions.cc b/content/browser/notifications/notification_database_data_conversions.cc
index 349b9c834b49c127d5be69eea6c9aeb869e65f05..be23cf661182d193a349a231125de97b55e34a09 100644
--- a/content/browser/notifications/notification_database_data_conversions.cc
+++ b/content/browser/notifications/notification_database_data_conversions.cc
@@ -52,6 +52,13 @@ bool DeserializeNotificationDatabaseData(const std::string& input,
payload.data().end());
}
+ for (const auto& payload_action : payload.actions()) {
+ PlatformNotificationAction action;
+ action.action = payload_action.action();
+ action.title = base::UTF8ToUTF16(payload_action.title());
+ notification_data->actions.push_back(action);
+ }
+
return true;
}
@@ -85,6 +92,13 @@ bool SerializeNotificationDatabaseData(const NotificationDatabaseData& input,
notification_data.data.size());
}
+ for (const PlatformNotificationAction& action : notification_data.actions) {
+ NotificationDatabaseDataProto::NotificationAction* payload_action =
+ payload->add_actions();
+ payload_action->set_action(action.action);
+ payload_action->set_title(base::UTF16ToUTF8(action.title));
+ }
+
NotificationDatabaseDataProto message;
message.set_notification_id(input.notification_id);
message.set_origin(input.origin.spec());

Powered by Google App Engine
This is Rietveld 408576698