| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_UI_COCOA_NOTIFICATIONS_NOTIFICATION_DELIVERY_H_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_NOTIFICATIONS_NOTIFICATION_DELIVERY_H_ |
| 6 #define CHROME_BROWSER_UI_COCOA_NOTIFICATIONS_NOTIFICATION_DELIVERY_H_ | 6 #define CHROME_BROWSER_UI_COCOA_NOTIFICATIONS_NOTIFICATION_DELIVERY_H_ |
| 7 | 7 |
| 8 #import <Foundation/Foundation.h> | 8 #import <Foundation/Foundation.h> |
| 9 | 9 |
| 10 #import "chrome/browser/ui/cocoa/notifications/xpc_mach_port.h" | 10 #import "chrome/browser/ui/cocoa/notifications/xpc_mach_port.h" |
| 11 | 11 |
| 12 // Collection of protocols used for XPC communication between chrome | 12 // Collection of protocols used for XPC communication between chrome |
| 13 // and the alert notification xpc service. | 13 // and the alert notification xpc service. |
| 14 | 14 |
| 15 // Protocol for the XPC notification service. | 15 // Protocol for the XPC notification service. |
| 16 @protocol NotificationDelivery | 16 @protocol NotificationDelivery |
| 17 | 17 |
| 18 // Sets the Mach exception handler port to use for the XPCService. | 18 // Sets the Mach exception handler port to use for the XPCService. |
| 19 - (void)setMachExceptionPort:(CrXPCMachPort*)port; | 19 - (void)setMachExceptionPort:(CrXPCMachPort*)port; |
| 20 | 20 |
| 21 // |notificationData| is generated using a NofiticationBuilder object. | 21 // |notificationData| is generated using a NofiticationBuilder object. |
| 22 - (void)deliverNotification:(NSDictionary*)notificationData; | 22 - (void)deliverNotification:(NSDictionary*)notificationData; |
| 23 | 23 |
| 24 // Closes an alert with the given |notificationId| and |profileId|. | 24 // Closes an alert with the given |notificationId| and |profileId|. |
| 25 - (void)closeNotificationWithId:(NSString*)notificationId | 25 - (void)closeNotificationWithId:(NSString*)notificationId |
| 26 withProfileId:(NSString*)profileId; | 26 withProfileId:(NSString*)profileId; |
| 27 | 27 |
| 28 // Closes all the alerts being displayed. | 28 // Closes all the alerts being displayed. |
| 29 - (void)closeAllNotifications; | 29 - (void)closeAllNotifications; |
| 30 |
| 31 // Will invoke |reply| with an array of NSString notification IDs for all alerts |
| 32 // for |profileId| and |incognito| value currently displayed. |
| 33 - (void)getDisplayedAlertsForProfileId:(NSString*)profileId |
| 34 andIncognito:(BOOL)incognito |
| 35 withReply:(void (^)(NSArray*))reply; |
| 30 @end | 36 @end |
| 31 | 37 |
| 32 // Response protocol for the XPC notification service to notify Chrome of | 38 // Response protocol for the XPC notification service to notify Chrome of |
| 33 // notification interactions. | 39 // notification interactions. |
| 34 @protocol NotificationReply | 40 @protocol NotificationReply |
| 35 | 41 |
| 36 // |notificationResponseData| is generated through a | 42 // |notificationResponseData| is generated through a |
| 37 // NotificationResponseBuilder. | 43 // NotificationResponseBuilder. |
| 38 - (void)notificationClick:(NSDictionary*)notificationResponseData; | 44 - (void)notificationClick:(NSDictionary*)notificationResponseData; |
| 39 | 45 |
| 40 @end | 46 @end |
| 41 | 47 |
| 42 #endif // CHROME_BROWSER_UI_COCOA_NOTIFICATIONS_NOTIFICATION_DELIVERY_H_ | 48 #endif // CHROME_BROWSER_UI_COCOA_NOTIFICATIONS_NOTIFICATION_DELIVERY_H_ |
| OLD | NEW |