Index: chrome/browser/notifications/platform_notification_service_impl.cc |
diff --git a/chrome/browser/notifications/platform_notification_service_impl.cc b/chrome/browser/notifications/platform_notification_service_impl.cc |
index e8a668d30dfa1c77c4041830b5fcf9f3aca3ab3b..420f413d6fb150e5473ea569d846f6674b2516a1 100644 |
--- a/chrome/browser/notifications/platform_notification_service_impl.cc |
+++ b/chrome/browser/notifications/platform_notification_service_impl.cc |
@@ -410,20 +410,17 @@ void PlatformNotificationServiceImpl::ClosePersistentNotification( |
bool cancel_by_persistent_id = |
GetNotificationDisplayService(profile)->SupportsNotificationCenter(); |
#endif |
- |
+ auto iter = persistent_notifications_.find(persistent_notification_id); |
+ if (iter == persistent_notifications_.end()) |
+ return; |
Peter Beverloo
2016/06/26 20:46:26
This will break closing persistent notifications s
Miguel Garcia
2016/06/28 08:17:20
True, changed it a bit to reflect that case, if in
|
if (cancel_by_persistent_id) { |
// TODO(peter): Remove this conversion when the notification ids are being |
// generated by the caller of this method. |
GetNotificationDisplayService(profile)->Close( |
base::Int64ToString(persistent_notification_id)); |
+ } else { |
+ GetNotificationDisplayService(profile)->Close(iter->second); |
Peter Beverloo
2016/06/26 20:46:26
Is invoking Close() twice with different values a
Miguel Garcia
2016/06/28 08:17:20
It isn't but in a world with an XPC service it wil
|
} |
- |
- auto iter = persistent_notifications_.find(persistent_notification_id); |
- if (iter == persistent_notifications_.end()) |
- return; |
- |
- GetNotificationDisplayService(profile)->Close(iter->second); |
- |
persistent_notifications_.erase(iter); |
} |