Chromium Code Reviews| Index: chrome/browser/notifications/notification_platform_bridge_linux.cc |
| diff --git a/chrome/browser/notifications/notification_platform_bridge_linux.cc b/chrome/browser/notifications/notification_platform_bridge_linux.cc |
| index 9601a847ed0c27ce0b24d2be8f7fc1989e14ed82..7ac30813b4724bad95f5389133e8a146b174caa1 100644 |
| --- a/chrome/browser/notifications/notification_platform_bridge_linux.cc |
| +++ b/chrome/browser/notifications/notification_platform_bridge_linux.cc |
| @@ -440,11 +440,24 @@ class NotificationPlatformBridgeLinuxImpl |
| std::string body; |
| if (base::ContainsKey(capabilities_, "body")) { |
| body = base::UTF16ToUTF8(notification->message()); |
| - if (base::ContainsKey(capabilities_, "body-markup")) { |
| + const bool body_markup = base::ContainsKey(capabilities_, "body-markup"); |
| + if (body_markup) { |
| base::ReplaceSubstringsAfterOffset(&body, 0, "&", "&"); |
| base::ReplaceSubstringsAfterOffset(&body, 0, "<", "<"); |
| base::ReplaceSubstringsAfterOffset(&body, 0, ">", ">"); |
| } |
| + if (notification->type() == message_center::NOTIFICATION_TYPE_MULTIPLE) { |
| + for (const auto& item : notification->items()) { |
| + if (!body.empty()) |
| + body += "\n"; |
| + const std::string title = base::UTF16ToUTF8(item.title); |
| + const std::string message = base::UTF16ToUTF8(item.message); |
| + if (body_markup) |
| + body += "<b>" + title + "</b> " + message; |
|
Peter Beverloo
2017/05/09 22:52:04
Could you add a TODO (in my name if you prefer) to
Tom (Use chromium acct)
2017/05/10 20:41:31
Done.
|
| + else |
| + body += title + " - " + message; |
|
Peter Beverloo
2017/05/09 22:52:04
Does the newline (:452) work even for notification
Tom (Use chromium acct)
2017/05/10 20:41:31
Yes
|
| + } |
| + } |
| } |
| writer.AppendString(body); |