|
@@ -65,4 +65,28 @@
|
|
|
return YES;
|
|
|
}
|
|
|
|
|
|
+#if !defined(MAS_BUILD)
|
|
|
+// This undocumented method notifies us if a user closes "Alert" notifications
|
|
|
+// https://chromium.googlesource.com/chromium/src/+/lkgr/chrome/browser/notifications/notification_platform_bridge_mac.mm
|
|
|
+- (void)userNotificationCenter:(NSUserNotificationCenter*)center
|
|
|
+ didDismissAlert:(NSUserNotification*)notif {
|
|
|
+ auto* notification = presenter_->GetNotification(notif);
|
|
|
+ if (notification)
|
|
|
+ notification->NotificationDismissed();
|
|
|
+}
|
|
|
+#endif
|
|
|
+
|
|
|
+#if !defined(MAS_BUILD)
|
|
|
+// This undocumented method notifies us if a user closes "Banner" notifications
|
|
|
+// https://github.com/mozilla/gecko-dev/blob/master/widget/cocoa/OSXNotificationCenter.mm
|
|
|
+- (void)userNotificationCenter:(NSUserNotificationCenter*)center
|
|
|
+ didRemoveDeliveredNotifications:(NSArray*)notifications {
|
|
|
+ for (NSUserNotification* notif in notifications) {
|
|
|
+ auto* notification = presenter_->GetNotification(notif);
|
|
|
+ if (notification)
|
|
|
+ notification->NotificationDismissed();
|
|
|
+ }
|
|
|
+}
|
|
|
+#endif
|
|
|
+
|
|
|
@end
|