| 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 5da5aae7c02b348cb9d873b41bacd45e07417e4f..8978887317d7f36b1f2f7aa2ed4ad19dce479652 100644
|
| --- a/content/browser/notifications/notification_database_data_conversions.cc
|
| +++ b/content/browser/notifications/notification_database_data_conversions.cc
|
| @@ -71,9 +71,22 @@ bool DeserializeNotificationDatabaseData(const std::string& input,
|
|
|
| for (const auto& payload_action : payload.actions()) {
|
| PlatformNotificationAction action;
|
| +
|
| + switch (payload_action.type()) {
|
| + case NotificationDatabaseDataProto::NotificationAction::BUTTON:
|
| + action.type = PLATFORM_NOTIFICATION_ACTION_TYPE_BUTTON;
|
| + break;
|
| + case NotificationDatabaseDataProto::NotificationAction::TEXT:
|
| + action.type = PLATFORM_NOTIFICATION_ACTION_TYPE_TEXT;
|
| + break;
|
| + default:
|
| + NOTREACHED();
|
| + }
|
| +
|
| action.action = payload_action.action();
|
| action.title = base::UTF8ToUTF16(payload_action.title());
|
| action.icon = GURL(payload_action.icon());
|
| + action.placeholder = base::UTF8ToUTF16(payload_action.placeholder());
|
| notification_data->actions.push_back(action);
|
| }
|
|
|
| @@ -128,9 +141,24 @@ bool SerializeNotificationDatabaseData(const NotificationDatabaseData& input,
|
| for (const PlatformNotificationAction& action : notification_data.actions) {
|
| NotificationDatabaseDataProto::NotificationAction* payload_action =
|
| payload->add_actions();
|
| +
|
| + switch (action.type) {
|
| + case PLATFORM_NOTIFICATION_ACTION_TYPE_BUTTON:
|
| + payload_action->set_type(
|
| + NotificationDatabaseDataProto::NotificationAction::BUTTON);
|
| + break;
|
| + case PLATFORM_NOTIFICATION_ACTION_TYPE_TEXT:
|
| + payload_action->set_type(
|
| + NotificationDatabaseDataProto::NotificationAction::TEXT);
|
| + break;
|
| + default:
|
| + NOTREACHED() << "Unknown action type: " << action.type;
|
| + }
|
| +
|
| payload_action->set_action(action.action);
|
| payload_action->set_title(base::UTF16ToUTF8(action.title));
|
| payload_action->set_icon(action.icon.spec());
|
| + payload_action->set_placeholder(base::UTF16ToUTF8(action.placeholder));
|
| }
|
|
|
| NotificationDatabaseDataProto message;
|
|
|