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 e60cdd6f8c11a0a9b8e80ab4bde751eb77425501..9376d91c85f4f3bf6f0bd5f304b4cdee6c76b2ed 100644 |
--- a/chrome/browser/notifications/message_center_notification_manager.cc |
+++ b/chrome/browser/notifications/message_center_notification_manager.cc |
@@ -80,6 +80,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; |
@@ -257,6 +261,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( |