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

Unified Diff: chrome/browser/notifications/notification_platform_bridge_linux.cc

Issue 2875443002: Linux native notifications: Support list notifications (Closed)
Patch Set: Created 3 years, 7 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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, "<", "&lt;");
base::ReplaceSubstringsAfterOffset(&body, 0, ">", "&gt;");
}
+ 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);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698