Chromium Code Reviews| Index: chrome/browser/notifications/balloon_notification_ui_manager.cc |
| diff --git a/chrome/browser/notifications/balloon_notification_ui_manager.cc b/chrome/browser/notifications/balloon_notification_ui_manager.cc |
| index 63883975653ca8129af3b6d1dffd1e5d61d22141..f0fd9e427860900452bb5b9b26712c50b907a1bb 100644 |
| --- a/chrome/browser/notifications/balloon_notification_ui_manager.cc |
| +++ b/chrome/browser/notifications/balloon_notification_ui_manager.cc |
| @@ -59,6 +59,26 @@ bool BalloonNotificationUIManager::CancelById(const std::string& id) { |
| return balloon_collection_->RemoveById(id); |
| } |
| +void BalloonNotificationUIManager::GetAllIdsByProfileAndSourceOrigin( |
| + Profile* profile, |
| + const GURL& source, |
| + std::set<std::string>* notification_ids) { |
| + DCHECK(notification_ids); |
| + NotificationUIManagerImpl::GetAllIdsByProfileAndSourceOrigin( |
| + profile, source, notification_ids); |
| + |
| + const BalloonCollection::Balloons& balloons = |
| + balloon_collection_->GetActiveBalloons(); |
| + for (BalloonCollection::Balloons::const_iterator iter = balloons.begin(); |
| + iter != balloons.end(); |
|
Dmitry Titov
2013/05/16 20:39:15
this loop can be in 2 lines.
dewittj
2013/05/16 23:40:34
ALL HAIL CLANG-FORMAT-DIFF
|
| + ++iter) { |
| + if (profile == (*iter)->profile() && |
| + source == (*iter)->notification().origin_url()) { |
| + notification_ids->insert((*iter)->notification().notification_id()); |
| + } |
| + } |
| +} |
| + |
| bool BalloonNotificationUIManager::CancelAllBySourceOrigin(const GURL& source) { |
| // Same pattern as CancelById, but more complicated than the above |
| // because there may be multiple notifications from the same source. |