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

Unified Diff: chrome/browser/notifications/desktop_notification_service.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: 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/desktop_notification_service.cc
diff --git a/chrome/browser/notifications/desktop_notification_service.cc b/chrome/browser/notifications/desktop_notification_service.cc
index 2568fb5727ac8805f7336617e69c1ee740df6275..7e2b458e305db9e5a9f10cdb718136cf5c9f638f 100644
--- a/chrome/browser/notifications/desktop_notification_service.cc
+++ b/chrome/browser/notifications/desktop_notification_service.cc
@@ -276,7 +276,8 @@ void DesktopNotificationService::RemoveNotification(
g_browser_process->notification_ui_manager()->CancelById(notification_id);
}
-DesktopNotificationService::DesktopNotificationService(Profile* profile,
+DesktopNotificationService::DesktopNotificationService(
+ Profile* profile,
NotificationUIManager* ui_manager)
: profile_(profile),
ui_manager_(ui_manager) {
@@ -338,6 +339,10 @@ void DesktopNotificationService::Observe(
CancelAllBySourceOrigin(extension->url());
}
} else if (type == chrome::NOTIFICATION_PROFILE_DESTROYED) {
+ if (g_browser_process && g_browser_process->notification_ui_manager()) {
+ g_browser_process->notification_ui_manager()->
+ CancelAllByProfile(profile_);
+ }
StopObserving();
}
}

Powered by Google App Engine
This is Rietveld 408576698