Index: chrome/browser/notifications/platform_notification_service_impl.cc |
diff --git a/chrome/browser/notifications/platform_notification_service_impl.cc b/chrome/browser/notifications/platform_notification_service_impl.cc |
index 21baeb7c83239ea682f8c62809c6d8467d86a9fa..019237b0ac2f1bd5d0c46b012e2dd82bfd4526e3 100644 |
--- a/chrome/browser/notifications/platform_notification_service_impl.cc |
+++ b/chrome/browser/notifications/platform_notification_service_impl.cc |
@@ -306,6 +306,26 @@ void PlatformNotificationServiceImpl::ClosePersistentNotification( |
#endif |
} |
+bool PlatformNotificationServiceImpl::GetDisplayedPersistentNotifications( |
+ BrowserContext* browser_context, |
+ std::set<std::string>* displayed_notifications) { |
+ DCHECK(displayed_notifications); |
+ |
+#if !defined(OS_ANDROID) |
+ Profile* profile = Profile::FromBrowserContext(browser_context); |
+ |
+ // TODO(peter): Filter for persistent notifications only. |
johnme
2015/05/14 15:22:32
How hard would it be to implement this TODO now? I
Peter Beverloo
2015/05/14 16:03:34
No, that's not the case, the delegate ids for pers
|
+ *displayed_notifications = |
+ GetNotificationUIManager()->GetAllIdsByProfile(profile); |
+ |
+ return true; |
+#else |
+ // Android cannot reliably return the notifications that are currently being |
+ // displayed on the platform, see the comment in NotificationUIManagerAndroid. |
+ return false; |
+#endif |
johnme
2015/05/14 15:22:32
Micro-nit: #endif // !defined(OS_ANDROID)
Peter Beverloo
2015/05/14 16:03:34
Done.
|
+} |
+ |
Notification PlatformNotificationServiceImpl::CreateNotificationFromData( |
Profile* profile, |
const GURL& origin, |