Commit b3cb2417 authored by Nina Satragno's avatar Nina Satragno Committed by Chromium LUCI CQ

Revert "Pass incognito flag when closing macOS alerts"

This reverts commit e48554ec.

Reason for revert: breaks NotificationPlatformBridgeMacTest.TestIncognitoProfile
 on Mac10.12 Tests

See https://ci.chromium.org/ui/p/chromium/builders/ci/Mac10.12%20Tests/41203/overview

Original change's description:
> Pass incognito flag when closing macOS alerts
>
> A macOS notification is identified with the tuple
> {notificationId, profileId, incognito} and we have to pass these down to
> the XPC service to close the correct notification. The same applies to
> the notification id used in the UNNotification API where we need to
> include the incognito flag in the id. Also updates some method names to
> be more consistent.
>
> Bug: None
> Change-Id: Ie45cb74eab182e0b495560110d8e6e32367c4bc7
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2642275
> Reviewed-by: Rayan Kanso <rayankans@chromium.org>
> Commit-Queue: Richard Knoll <knollr@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#846183}

TBR=rayankans@chromium.org,knollr@chromium.org,chromium-scoped@luci-project-accounts.iam.gserviceaccount.com

Change-Id: I0d1344c1f61a8dc04a156a94810a8059ffa55e6a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: None
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2645156Reviewed-by: default avatarRichard Knoll <knollr@chromium.org>
Commit-Queue: Nina Satragno <nsatragno@chromium.org>
Cr-Commit-Position: refs/heads/master@{#846345}
parent 3fe154df
...@@ -15,17 +15,14 @@ ...@@ -15,17 +15,14 @@
// Deliver a notification to the XPC service to be displayed as an alert. // Deliver a notification to the XPC service to be displayed as an alert.
- (void)dispatchNotification:(NSDictionary*)data; - (void)dispatchNotification:(NSDictionary*)data;
// Close a notification for a given |notificationId|, |profileId| and // Close a notification for a given |notificationId| and |profileId|.
// |incognito|.
- (void)closeNotificationWithId:(NSString*)notificationId - (void)closeNotificationWithId:(NSString*)notificationId
profileId:(NSString*)profileId withProfileId:(NSString*)profileId;
incognito:(BOOL)incognito;
// Close all notifications. // Close all notifications.
- (void)closeAllNotifications; - (void)closeAllNotifications;
// Get currently displayed notifications for |profileId| and |incognito|. The // Get currently displayed notifications.
// returned ids are scoped to the passed profile and are not globally unique.
- (void) - (void)
getDisplayedAlertsForProfileId:(NSString*)profileId getDisplayedAlertsForProfileId:(NSString*)profileId
incognito:(BOOL)incognito incognito:(BOOL)incognito
......
...@@ -221,32 +221,32 @@ void NotificationPlatformBridgeMac::Display( ...@@ -221,32 +221,32 @@ void NotificationPlatformBridgeMac::Display(
void NotificationPlatformBridgeMac::Close(Profile* profile, void NotificationPlatformBridgeMac::Close(Profile* profile,
const std::string& notification_id) { const std::string& notification_id) {
NSString* notificationId = base::SysUTF8ToNSString(notification_id); NSString* candidate_id = base::SysUTF8ToNSString(notification_id);
NSString* profileId = base::SysUTF8ToNSString(GetProfileId(profile)); NSString* current_profile_id = base::SysUTF8ToNSString(GetProfileId(profile));
bool incognito = profile->IsOffTheRecord();
bool notification_removed = false;
for (NSUserNotification* toast in for (NSUserNotification* toast in
[notification_center_ deliveredNotifications]) { [notification_center_ deliveredNotifications]) {
NSString* toastId = NSString* toast_id =
[toast.userInfo objectForKey:notification_constants::kNotificationId]; [toast.userInfo objectForKey:notification_constants::kNotificationId];
NSString* toastProfileId = [toast.userInfo
NSString* persistent_profile_id = [toast.userInfo
objectForKey:notification_constants::kNotificationProfileId]; objectForKey:notification_constants::kNotificationProfileId];
BOOL toastIncognito = [[toast.userInfo
objectForKey:notification_constants::kNotificationIncognito] boolValue];
if ([notificationId isEqualToString:toastId] && if ([toast_id isEqualToString:candidate_id] &&
[profileId isEqualToString:toastProfileId] && [persistent_profile_id isEqualToString:current_profile_id]) {
incognito == toastIncognito) {
[notification_center_ removeDeliveredNotification:toast]; [notification_center_ removeDeliveredNotification:toast];
return; notification_removed = true;
break;
} }
} }
// If no banner existed with that ID try to see if there is an alert // If no banner existed with that ID try to see if there is an alert
// in the xpc server. // in the xpc server.
[alert_dispatcher_ closeNotificationWithId:notificationId if (!notification_removed) {
profileId:profileId [alert_dispatcher_ closeNotificationWithId:candidate_id
incognito:incognito]; withProfileId:current_profile_id];
}
} }
void NotificationPlatformBridgeMac::GetDisplayed( void NotificationPlatformBridgeMac::GetDisplayed(
...@@ -280,8 +280,9 @@ void NotificationPlatformBridgeMac::GetDisplayed( ...@@ -280,8 +280,9 @@ void NotificationPlatformBridgeMac::GetDisplayed(
}, },
std::move(callback), std::move(banners)); std::move(callback), std::move(banners));
[alert_dispatcher_ getDisplayedAlertsForProfileId:profileId [alert_dispatcher_ getDisplayedAlertsForProfileId:base::SysUTF8ToNSString(
incognito:incognito GetProfileId(profile))
incognito:profile->IsOffTheRecord()
callback:std::move(alerts_callback)]; callback:std::move(alerts_callback)];
} }
...@@ -386,11 +387,9 @@ void NotificationPlatformBridgeMac::DisplayServiceShutDown(Profile* profile) {} ...@@ -386,11 +387,9 @@ void NotificationPlatformBridgeMac::DisplayServiceShutDown(Profile* profile) {}
} }
- (void)closeNotificationWithId:(NSString*)notificationId - (void)closeNotificationWithId:(NSString*)notificationId
profileId:(NSString*)profileId withProfileId:(NSString*)profileId {
incognito:(BOOL)incognito {
[[self serviceProxy] closeNotificationWithId:notificationId [[self serviceProxy] closeNotificationWithId:notificationId
profileId:profileId withProfileId:profileId];
incognito:incognito];
} }
- (void)closeAllNotifications { - (void)closeAllNotifications {
...@@ -413,12 +412,12 @@ getDisplayedAlertsForProfileId:(NSString*)profileId ...@@ -413,12 +412,12 @@ getDisplayedAlertsForProfileId:(NSString*)profileId
content::GetUIThreadTaskRunner({})->PostTask( content::GetUIThreadTaskRunner({})->PostTask(
FROM_HERE, FROM_HERE,
base::BindOnce(copyable_callback, std::move(displayedNotifications), base::BindOnce(copyable_callback, std::move(displayedNotifications),
/*supports_synchronization=*/true)); true /* supports_synchronization */));
}; };
[[self serviceProxy] getDisplayedAlertsForProfileId:profileId [[self serviceProxy] getDisplayedAlertsForProfileId:profileId
incognito:incognito andIncognito:incognito
reply:reply]; withReply:reply];
} }
// NotificationReply: // NotificationReply:
......
...@@ -144,42 +144,6 @@ TEST_F(NotificationPlatformBridgeMacTest, TestDisplayNoButtons) { ...@@ -144,42 +144,6 @@ TEST_F(NotificationPlatformBridgeMacTest, TestDisplayNoButtons) {
EXPECT_NSEQ(@"Close", [delivered_notification otherButtonTitle]); EXPECT_NSEQ(@"Close", [delivered_notification otherButtonTitle]);
} }
TEST_F(NotificationPlatformBridgeMacTest, TestIncognitoProfile) {
std::unique_ptr<NotificationPlatformBridgeMac> bridge(
new NotificationPlatformBridgeMac(notification_center(),
alert_dispatcher()));
std::unique_ptr<Notification> notification =
CreateBanner("Title", "Context", "https://gmail.com", nullptr, nullptr);
TestingProfile::Builder profile_builder;
profile_builder.SetPath(profile()->GetPath());
profile_builder.SetProfileName(profile()->GetProfileUserName());
Profile* incogito_profile = profile_builder.BuildIncognito(profile());
// Show two notifications with the same id from different profiles.
bridge->Display(NotificationHandler::Type::WEB_PERSISTENT, profile(),
*notification, /*metadata=*/nullptr);
bridge->Display(NotificationHandler::Type::WEB_PERSISTENT, incogito_profile,
*notification, /*metadata=*/nullptr);
EXPECT_EQ(2u, [[notification_center() deliveredNotifications] count]);
// Close the one for the incognito profile.
bridge->Close(incogito_profile, "id1");
NSArray* notifications = [notification_center() deliveredNotifications];
ASSERT_EQ(1u, [notifications count]);
// Expect that the remaining notification is for the regular profile.
NSUserNotification* remaining_notification = [notifications objectAtIndex:0];
EXPECT_EQ(false,
[[[remaining_notification userInfo]
objectForKey:notification_constants::kNotificationIncognito]
boolValue]);
// Close the one for the regular profile.
bridge->Close(profile(), "id1");
EXPECT_EQ(0u, [[notification_center() deliveredNotifications] count]);
}
TEST_F(NotificationPlatformBridgeMacTest, TestDisplayNoSettings) { TEST_F(NotificationPlatformBridgeMacTest, TestDisplayNoSettings) {
std::unique_ptr<Notification> notification = CreateNotification( std::unique_ptr<Notification> notification = CreateNotification(
"Title", "Context", "https://gmail.com", nullptr, nullptr, "Title", "Context", "https://gmail.com", nullptr, nullptr,
......
...@@ -154,8 +154,8 @@ void NotificationPlatformBridgeMacUNNotification::Display( ...@@ -154,8 +154,8 @@ void NotificationPlatformBridgeMacUNNotification::Display(
// Create a new category from the desired action buttons. // Create a new category from the desired action buttons.
UNNotificationCategory* category = [builder buildCategory]; UNNotificationCategory* category = [builder buildCategory];
std::string system_notification_id = DeriveMacNotificationId( std::string system_notification_id =
profile->IsOffTheRecord(), GetProfileId(profile), notification.id()); DeriveMacNotificationId(GetProfileId(profile), notification.id());
NSString* notification_id = base::SysUTF8ToNSString(system_notification_id); NSString* notification_id = base::SysUTF8ToNSString(system_notification_id);
// Check if this notification had an already existing category from a previous // Check if this notification had an already existing category from a previous
...@@ -218,8 +218,8 @@ void NotificationPlatformBridgeMacUNNotification::Display( ...@@ -218,8 +218,8 @@ void NotificationPlatformBridgeMacUNNotification::Display(
void NotificationPlatformBridgeMacUNNotification::Close( void NotificationPlatformBridgeMacUNNotification::Close(
Profile* profile, Profile* profile,
const std::string& notification_id) { const std::string& notification_id) {
NSString* notificationId = base::SysUTF8ToNSString(DeriveMacNotificationId( NSString* notificationId = base::SysUTF8ToNSString(
profile->IsOffTheRecord(), GetProfileId(profile), notification_id)); DeriveMacNotificationId(GetProfileId(profile), notification_id));
base::WeakPtr<NotificationPlatformBridgeMacUNNotification> weak_ptr = base::WeakPtr<NotificationPlatformBridgeMacUNNotification> weak_ptr =
weak_factory_.GetWeakPtr(); weak_factory_.GetWeakPtr();
......
...@@ -254,56 +254,6 @@ TEST_F(UNNotificationPlatformBridgeMacTest, TestDisplayMultipleProfiles) { ...@@ -254,56 +254,6 @@ TEST_F(UNNotificationPlatformBridgeMacTest, TestDisplayMultipleProfiles) {
} }
} }
TEST_F(UNNotificationPlatformBridgeMacTest, TestIncognitoProfile) {
if (@available(macOS 10.14, *)) {
Notification notification = CreateNotification();
TestingProfile::Builder profile_builder;
profile_builder.SetPath(profile_->GetPath());
profile_builder.SetProfileName(profile_->GetProfileUserName());
Profile* incogito_profile = profile_builder.BuildIncognito(profile_);
// Show two notifications with the same id from different profiles.
bridge_->Display(NotificationHandler::Type::WEB_PERSISTENT, profile_,
notification, /*metadata=*/nullptr);
bridge_->Display(NotificationHandler::Type::WEB_PERSISTENT,
incogito_profile, notification,
/*metadata=*/nullptr);
[center_ getDeliveredNotificationsWithCompletionHandler:^(
NSArray<UNNotification*>* _Nonnull notifications) {
EXPECT_EQ(2u, [notifications count]);
}];
// Close the one for the incognito profile.
bridge_->Close(incogito_profile, "id1");
// Close runs async code that we can't observe, make sure all tasks run.
base::RunLoop().RunUntilIdle();
__block UNNotification* remaining = nullptr;
[center_ getDeliveredNotificationsWithCompletionHandler:^(
NSArray<UNNotification*>* _Nonnull notifications) {
ASSERT_EQ(1u, [notifications count]);
remaining = [notifications objectAtIndex:0];
}];
// Expect that the remaining notification is for the regular profile.
EXPECT_EQ(false,
[[[[[remaining request] content] userInfo]
objectForKey:notification_constants::kNotificationIncognito]
boolValue]);
// Close the one for the regular profile.
bridge_->Close(profile_, "id1");
// Close runs async code that we can't observe, make sure all tasks run.
base::RunLoop().RunUntilIdle();
[center_ getDeliveredNotificationsWithCompletionHandler:^(
NSArray<UNNotification*>* _Nonnull notifications) {
EXPECT_EQ(0u, [notifications count]);
}];
}
}
TEST_F(UNNotificationPlatformBridgeMacTest, TestNotificationHasIcon) { TEST_F(UNNotificationPlatformBridgeMacTest, TestNotificationHasIcon) {
if (@available(macOS 10.14, *)) { if (@available(macOS 10.14, *)) {
Notification notification = CreateNotification(); Notification notification = CreateNotification();
......
...@@ -28,8 +28,7 @@ base::string16 CreateMacNotificationContext( ...@@ -28,8 +28,7 @@ base::string16 CreateMacNotificationContext(
// Derives a unique notification identifier to be used by the macOS system // Derives a unique notification identifier to be used by the macOS system
// notification center to uniquely identify a notification. // notification center to uniquely identify a notification.
std::string DeriveMacNotificationId(bool incognito, std::string DeriveMacNotificationId(const std::string& profile_id,
const std::string& profile_id,
const std::string& notification_id); const std::string& notification_id);
// Validates contents of the |response| dictionary as received from the system // Validates contents of the |response| dictionary as received from the system
......
...@@ -125,12 +125,9 @@ base::string16 CreateMacNotificationContext( ...@@ -125,12 +125,9 @@ base::string16 CreateMacNotificationContext(
return etldplusone; return etldplusone;
} }
std::string DeriveMacNotificationId(bool incognito, std::string DeriveMacNotificationId(const std::string& profile_id,
const std::string& profile_id,
const std::string& notification_id) { const std::string& notification_id) {
// i: incognito, r: regular profile return base::StrCat({profile_id, "|", notification_id});
return base::StrCat(
{incognito ? "i" : "r", "|", profile_id, "|", notification_id});
} }
bool VerifyMacNotificationData(NSDictionary* response) { bool VerifyMacNotificationData(NSDictionary* response) {
......
...@@ -29,21 +29,16 @@ ...@@ -29,21 +29,16 @@
} }
- (void)closeNotificationWithId:(NSString*)notificationId - (void)closeNotificationWithId:(NSString*)notificationId
profileId:(NSString*)profileId withProfileId:(NSString*)profileId {
incognito:(BOOL)incognito {
DCHECK(profileId); DCHECK(profileId);
DCHECK(notificationId); DCHECK(notificationId);
for (NSDictionary* toast in _alerts.get()) { for (NSDictionary* toast in _alerts.get()) {
NSString* toastId = NSString* toastId =
[toast objectForKey:notification_constants::kNotificationId]; [toast objectForKey:notification_constants::kNotificationId];
NSString* toastProfileId = NSString* persistentProfileId =
[toast objectForKey:notification_constants::kNotificationProfileId]; [toast objectForKey:notification_constants::kNotificationProfileId];
BOOL toastIncognito = [[toast if ([toastId isEqualToString:notificationId] &&
objectForKey:notification_constants::kNotificationIncognito] boolValue]; [persistentProfileId isEqualToString:profileId]) {
if ([notificationId isEqualToString:toastId] &&
[profileId isEqualToString:toastProfileId] &&
incognito == toastIncognito) {
[_alerts removeObject:toast]; [_alerts removeObject:toast];
break; break;
} }
......
...@@ -41,20 +41,15 @@ ...@@ -41,20 +41,15 @@
objectForKey:notification_constants::kNotificationId]; objectForKey:notification_constants::kNotificationId];
NSString* profileId = [notification.userInfo NSString* profileId = [notification.userInfo
objectForKey:notification_constants::kNotificationProfileId]; objectForKey:notification_constants::kNotificationProfileId];
BOOL incognito = [[notification.userInfo
objectForKey:notification_constants::kNotificationIncognito] boolValue];
DCHECK(profileId); DCHECK(profileId);
DCHECK(notificationId); DCHECK(notificationId);
for (NSUserNotification* toast in _banners.get()) { for (NSUserNotification* toast in _banners.get()) {
NSString* toastId = NSString* toastId =
[toast.userInfo objectForKey:notification_constants::kNotificationId]; [toast.userInfo objectForKey:notification_constants::kNotificationId];
NSString* toastProfileId = [toast.userInfo NSString* persistentProfileId = [toast.userInfo
objectForKey:notification_constants::kNotificationProfileId]; objectForKey:notification_constants::kNotificationProfileId];
BOOL toastIncognito = [[toast.userInfo if ([toastId isEqualToString:notificationId] &&
objectForKey:notification_constants::kNotificationIncognito] boolValue]; [persistentProfileId isEqualToString:profileId]) {
if ([notificationId isEqualToString:toastId] &&
[profileId isEqualToString:toastProfileId] &&
incognito == toastIncognito) {
[_banners removeObject:toast]; [_banners removeObject:toast];
break; break;
} }
......
...@@ -84,14 +84,12 @@ crashpad::SimpleStringDictionary* GetCrashpadAnnotations() { ...@@ -84,14 +84,12 @@ crashpad::SimpleStringDictionary* GetCrashpadAnnotations() {
} }
- (void)closeNotificationWithId:(NSString*)notificationId - (void)closeNotificationWithId:(NSString*)notificationId
profileId:(NSString*)profileId withProfileId:(NSString*)profileId {
incognito:(BOOL)incognito {
DCHECK(_didSetExceptionPort); DCHECK(_didSetExceptionPort);
DCHECK(_notificationDelivery); DCHECK(_notificationDelivery);
[_notificationDelivery closeNotificationWithId:notificationId [_notificationDelivery closeNotificationWithId:notificationId
profileId:profileId withProfileId:profileId];
incognito:incognito];
} }
- (void)closeAllNotifications { - (void)closeAllNotifications {
...@@ -102,13 +100,13 @@ crashpad::SimpleStringDictionary* GetCrashpadAnnotations() { ...@@ -102,13 +100,13 @@ crashpad::SimpleStringDictionary* GetCrashpadAnnotations() {
} }
- (void)getDisplayedAlertsForProfileId:(NSString*)profileId - (void)getDisplayedAlertsForProfileId:(NSString*)profileId
incognito:(BOOL)incognito andIncognito:(BOOL)incognito
reply:(void (^)(NSArray*))reply { withReply:(void (^)(NSArray*))reply {
DCHECK(_notificationDelivery); DCHECK(_notificationDelivery);
[_notificationDelivery getDisplayedAlertsForProfileId:profileId [_notificationDelivery getDisplayedAlertsForProfileId:profileId
incognito:incognito andIncognito:incognito
reply:reply]; withReply:reply];
} }
@end @end
...@@ -49,23 +49,20 @@ ...@@ -49,23 +49,20 @@
} }
- (void)closeNotificationWithId:(NSString*)notificationId - (void)closeNotificationWithId:(NSString*)notificationId
profileId:(NSString*)profileId withProfileId:(NSString*)profileId {
incognito:(BOOL)incognito {
NSUserNotificationCenter* notificationCenter = NSUserNotificationCenter* notificationCenter =
[NSUserNotificationCenter defaultUserNotificationCenter]; [NSUserNotificationCenter defaultUserNotificationCenter];
NSArray* deliveredNotifications = [notificationCenter deliveredNotifications]; for (NSUserNotification* candidate in
for (NSUserNotification* toast in deliveredNotifications) { [notificationCenter deliveredNotifications]) {
NSString* toastId = NSString* candidateId = [candidate.userInfo
[toast.userInfo objectForKey:notification_constants::kNotificationId]; objectForKey:notification_constants::kNotificationId];
NSString* toastProfileId = [toast.userInfo
NSString* candidateProfileId = [candidate.userInfo
objectForKey:notification_constants::kNotificationProfileId]; objectForKey:notification_constants::kNotificationProfileId];
BOOL toastIncognito = [[toast.userInfo
objectForKey:notification_constants::kNotificationIncognito] boolValue];
if ([notificationId isEqualToString:toastId] && if ([candidateId isEqualToString:notificationId] &&
[profileId isEqualToString:toastProfileId] && [profileId isEqualToString:candidateProfileId]) {
incognito == toastIncognito) { [notificationCenter removeDeliveredNotification:candidate];
[notificationCenter removeDeliveredNotification:toast];
[_transactionHandler closeTransactionIfNeeded]; [_transactionHandler closeTransactionIfNeeded];
break; break;
} }
...@@ -79,21 +76,20 @@ ...@@ -79,21 +76,20 @@
} }
- (void)getDisplayedAlertsForProfileId:(NSString*)profileId - (void)getDisplayedAlertsForProfileId:(NSString*)profileId
incognito:(BOOL)incognito andIncognito:(BOOL)incognito
reply:(void (^)(NSArray*))reply { withReply:(void (^)(NSArray*))reply {
NSUserNotificationCenter* notificationCenter = NSUserNotificationCenter* notificationCenter =
[NSUserNotificationCenter defaultUserNotificationCenter]; [NSUserNotificationCenter defaultUserNotificationCenter];
NSArray* deliveredNotifications = [notificationCenter deliveredNotifications]; NSArray* deliveredNotifications = [notificationCenter deliveredNotifications];
NSMutableArray* notificationIds = NSMutableArray* notificationIds =
[NSMutableArray arrayWithCapacity:[deliveredNotifications count]]; [NSMutableArray arrayWithCapacity:[deliveredNotifications count]];
for (NSUserNotification* toast in deliveredNotifications) { for (NSUserNotification* toast in deliveredNotifications) {
NSString* toastProfileId = [toast.userInfo NSString* candidateProfileId = [toast.userInfo
objectForKey:notification_constants::kNotificationProfileId]; objectForKey:notification_constants::kNotificationProfileId];
BOOL toastIncognito = [[toast.userInfo BOOL incognitoNotification = [[toast.userInfo
objectForKey:notification_constants::kNotificationIncognito] boolValue]; objectForKey:notification_constants::kNotificationIncognito] boolValue];
if ([candidateProfileId isEqualToString:profileId] &&
if ([profileId isEqualToString:toastProfileId] && incognito == incognitoNotification) {
incognito == toastIncognito) {
[notificationIds [notificationIds
addObject:[toast.userInfo addObject:[toast.userInfo
objectForKey:notification_constants::kNotificationId]]; objectForKey:notification_constants::kNotificationId]];
......
...@@ -24,10 +24,9 @@ ...@@ -24,10 +24,9 @@
// |notificationData| is generated using a NofiticationBuilder object. // |notificationData| is generated using a NofiticationBuilder object.
- (void)deliverNotification:(NSDictionary*)notificationData; - (void)deliverNotification:(NSDictionary*)notificationData;
// Closes an alert with the given |notificationId|, |profileId| and |incognito|. // Closes an alert with the given |notificationId| and |profileId|.
- (void)closeNotificationWithId:(NSString*)notificationId - (void)closeNotificationWithId:(NSString*)notificationId
profileId:(NSString*)profileId withProfileId:(NSString*)profileId;
incognito:(BOOL)incognito;
// Closes all the alerts being displayed. // Closes all the alerts being displayed.
- (void)closeAllNotifications; - (void)closeAllNotifications;
...@@ -35,9 +34,8 @@ ...@@ -35,9 +34,8 @@
// Will invoke |reply| with an array of NSString notification IDs for all alerts // Will invoke |reply| with an array of NSString notification IDs for all alerts
// for |profileId| and |incognito| value currently displayed. // for |profileId| and |incognito| value currently displayed.
- (void)getDisplayedAlertsForProfileId:(NSString*)profileId - (void)getDisplayedAlertsForProfileId:(NSString*)profileId
incognito:(BOOL)incognito andIncognito:(BOOL)incognito
reply:(void (^)(NSArray*))reply; withReply:(void (^)(NSArray*))reply;
@end @end
// Response protocol for the XPC notification service to notify Chrome of // Response protocol for the XPC notification service to notify Chrome of
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment