Chromium Code Reviews| Index: chrome/browser/notifications/notification_ui_manager_impl.cc |
| diff --git a/chrome/browser/notifications/notification_ui_manager_impl.cc b/chrome/browser/notifications/notification_ui_manager_impl.cc |
| index 0bda94de4d5d0039760b5d009f7b861ed972018d..9ac16b82726d559537af1e5ed3bd5538c617a4fa 100644 |
| --- a/chrome/browser/notifications/notification_ui_manager_impl.cc |
| +++ b/chrome/browser/notifications/notification_ui_manager_impl.cc |
| @@ -95,6 +95,21 @@ bool NotificationUIManagerImpl::CancelById(const std::string& id) { |
| return false; |
| } |
| +std::set<std::string> |
| +NotificationUIManagerImpl::GetAllIdsByProfileAndSourceOrigin( |
| + Profile* profile, |
| + const GURL& source) { |
| + std::set<std::string> notification_ids; |
| + for (NotificationDeque::iterator iter = show_queue_.begin(); |
| + iter != show_queue_.end();) { |
| + if ((*iter)->notification().origin_url() == source && |
| + profile->IsSameProfile((*iter)->profile())) { |
| + notification_ids.insert((*iter)->notification().notification_id()); |
|
miket_OOO
2013/05/20 21:14:44
It's a code smell that I've now seen the same bloc
|
| + } |
| + } |
| + return notification_ids; |
| +} |
| + |
| bool NotificationUIManagerImpl::CancelAllBySourceOrigin(const GURL& source) { |
| // Same pattern as CancelById, but more complicated than the above |
| // because there may be multiple notifications from the same source. |