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

Unified Diff: chrome/browser/notifications/notification_platform_bridge_mac.mm

Issue 2818373004: Use notification type to detect progress notifications (Closed)
Patch Set: review Created 3 years, 8 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 | chrome/browser/notifications/notification_platform_bridge_mac_unittest.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/notifications/notification_platform_bridge_mac.mm
diff --git a/chrome/browser/notifications/notification_platform_bridge_mac.mm b/chrome/browser/notifications/notification_platform_bridge_mac.mm
index b3357a6ceb216506db1525ac67c10aba3b35f6dd..53c1bdf320d5968ac54f21dc14fdc021c18db5ec 100644
--- a/chrome/browser/notifications/notification_platform_bridge_mac.mm
+++ b/chrome/browser/notifications/notification_platform_bridge_mac.mm
@@ -39,6 +39,7 @@
#include "third_party/WebKit/public/platform/modules/notifications/WebNotificationConstants.h"
#include "third_party/crashpad/crashpad/client/crashpad_client.h"
#include "ui/base/l10n/l10n_util_mac.h"
+#include "ui/message_center/notification_types.h"
#include "url/gurl.h"
#include "url/origin.h"
@@ -118,7 +119,7 @@ void RecordXPCEvent(XPCConnectionEvent event) {
base::string16 CreateNotificationTitle(const Notification& notification) {
base::string16 title;
- if (notification.progress() > 0) {
+ if (notification.type() == message_center::NOTIFICATION_TYPE_PROGRESS) {
title += base::FormatPercent(notification.progress());
title += base::UTF8ToUTF16(" - ");
}
@@ -254,7 +255,8 @@ void NotificationPlatformBridgeMac::Display(
// can be displayed as alerts. Chrome itself can only display
// banners.
// Progress Notifications are always considered persistent.
- if (notification.never_timeout() || notification.progress() > 0) {
+ if (notification.never_timeout() ||
+ notification.type() == message_center::NOTIFICATION_TYPE_PROGRESS) {
NSDictionary* dict = [builder buildDictionary];
[alert_dispatcher_ dispatchNotification:dict];
} else {
« no previous file with comments | « no previous file | chrome/browser/notifications/notification_platform_bridge_mac_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698