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

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

Issue 14767029: Add API function chrome.notifications.getAll (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix merge that caused test error. Created 7 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/message_center_notification_manager.cc
diff --git a/chrome/browser/notifications/message_center_notification_manager.cc b/chrome/browser/notifications/message_center_notification_manager.cc
index 7be078329f2219bf73ccc49169562739f342be16..e46a89ae1fe174c38811894808a68c2336422f99 100644
--- a/chrome/browser/notifications/message_center_notification_manager.cc
+++ b/chrome/browser/notifications/message_center_notification_manager.cc
@@ -70,6 +70,24 @@ bool MessageCenterNotificationManager::CancelById(const std::string& id) {
return true;
}
+void MessageCenterNotificationManager::GetAllIdsByProfileAndSourceOrigin(
+ Profile* profile,
+ const GURL& source,
+ std::set<std::string>* notification_ids) {
+ DCHECK(notification_ids);
+ NotificationUIManagerImpl::GetAllIdsByProfileAndSourceOrigin(
+ profile, source, notification_ids);
+
+ for (NotificationMap::iterator loopiter = profile_notifications_.begin();
+ loopiter != profile_notifications_.end();) {
+ NotificationMap::iterator curiter = loopiter++;
+ if ((*curiter).second->notification().origin_url() == source &&
+ (*curiter).second->profile() == profile) {
Dmitry Titov 2013/05/16 20:39:15 Should it be == or IsSameProfile() ?
dewittj 2013/05/16 23:40:34 Good catch, probably the same extension would hand
+ notification_ids->insert(curiter->first);
+ }
+ }
+}
+
bool MessageCenterNotificationManager::CancelAllBySourceOrigin(
const GURL& source) {
// Same pattern as CancelById, but more complicated than the above

Powered by Google App Engine
This is Rietveld 408576698