| Index: chrome/browser/notifications/balloon_collection_base.cc
|
| diff --git a/chrome/browser/notifications/balloon_collection_base.cc b/chrome/browser/notifications/balloon_collection_base.cc
|
| index d66d7e921cca349c68b2769de5ba049957d67091..15ddef1e93adb775e6c4170fa3f098296db105ce 100644
|
| --- a/chrome/browser/notifications/balloon_collection_base.cc
|
| +++ b/chrome/browser/notifications/balloon_collection_base.cc
|
| @@ -66,6 +66,21 @@ bool BalloonCollectionBase::CloseAllBySourceOrigin(
|
| return !to_close.empty();
|
| }
|
|
|
| +bool BalloonCollectionBase::CloseAllByProfile(Profile* profile) {
|
| + // Use a local list of balloons to close to avoid breaking
|
| + // iterator changes on each close.
|
| + Balloons to_close;
|
| + Balloons::iterator iter;
|
| + for (iter = balloons_.begin(); iter != balloons_.end(); ++iter) {
|
| + if ((*iter)->profile() == profile)
|
| + to_close.push_back(*iter);
|
| + }
|
| + for (iter = to_close.begin(); iter != to_close.end(); ++iter)
|
| + (*iter)->CloseByScript();
|
| +
|
| + return !to_close.empty();
|
| +}
|
| +
|
| void BalloonCollectionBase::CloseAll() {
|
| // Use a local list of balloons to close to avoid breaking
|
| // iterator changes on each close.
|
|
|