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

Unified Diff: chrome/browser/extensions/api/notifications/extension_notification_display_helper.cc

Issue 2799343003: Add support for native extension notifications (Closed)
Patch Set: Created 3 years, 8 months 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/extensions/api/notifications/extension_notification_display_helper.cc
diff --git a/chrome/browser/extensions/api/notifications/extension_notification_display_helper.cc b/chrome/browser/extensions/api/notifications/extension_notification_display_helper.cc
index f6f507d6034c282fc4cfa38829e0b9b9cf2593eb..2882b2102336fbe773c4ab72566ba0bfe3850bd3 100644
--- a/chrome/browser/extensions/api/notifications/extension_notification_display_helper.cc
+++ b/chrome/browser/extensions/api/notifications/extension_notification_display_helper.cc
@@ -80,10 +80,11 @@ bool ExtensionNotificationDisplayHelper::Close(
}
void ExtensionNotificationDisplayHelper::Shutdown() {
- for (const std::unique_ptr<Notification>& notification : notifications_) {
- GetDisplayService()->Close(NotificationCommon::EXTENSION,
- notification->delegate_id());
- }
+ // Do not call GetDisplayService()->Close() here.
+ // This is called upon profile destruction and closing a notification
+ // requires a profile. Both the message center and the bridge
+ // notificatiosn will clean up notifications upon exit so all
+ // that is needed here is cleaning up the internal state.
notifications_.clear();
}

Powered by Google App Engine
This is Rietveld 408576698