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

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

Issue 11414215: Add CloseAllByProfile to NotificationUIManager and call before destroyng a Profile (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix mac Created 8 years, 1 month 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/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.
« no previous file with comments | « chrome/browser/notifications/balloon_collection_base.h ('k') | chrome/browser/notifications/balloon_collection_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698