Index: chrome/browser/notifications/message_center_notification_manager.cc |
diff --git a/chrome/browser/notifications/message_center_notification_manager.cc b/chrome/browser/notifications/message_center_notification_manager.cc |
index 8f884617f7d1f518f6d38ccda4593ca94c355977..7856230847d04dc3c4d565c2aa791025b9d50807 100644 |
--- a/chrome/browser/notifications/message_center_notification_manager.cc |
+++ b/chrome/browser/notifications/message_center_notification_manager.cc |
@@ -82,6 +82,10 @@ MessageCenterNotificationManager::~MessageCenterNotificationManager() { |
void MessageCenterNotificationManager::Add(const Notification& notification, |
Profile* profile) { |
+ // We won't have time to process and act on this notification. |
+ if (is_shutdown_started_) |
+ return; |
+ |
if (Update(notification, profile)) |
return; |
@@ -259,6 +263,11 @@ void MessageCenterNotificationManager::CancelAll() { |
false /* by_user */, message_center::MessageCenter::RemoveType::ALL); |
} |
+void MessageCenterNotificationManager::StartShutdown() { |
+ is_shutdown_started_ = true; |
+ CancelAll(); |
+} |
+ |
//////////////////////////////////////////////////////////////////////////////// |
// MessageCenter::Observer |
void MessageCenterNotificationManager::OnNotificationRemoved( |