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

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

Issue 1127013008: Beginnings of synchronizing notifications in the notification database. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
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,

Powered by Google App Engine
This is Rietveld 408576698