Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3596)

Unified Diff: chrome/browser/notifications/stub_notification_center_mac.mm

Issue 2479143003: Add tests for the XPC client. (Closed)
Patch Set: rename alert_dispatcher.h to alert_dispatcher_mac.h and add it to the BUILD.gn file Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/notifications/stub_alert_dispatcher_mac.mm ('k') | chrome/test/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/notifications/stub_notification_center_mac.mm
diff --git a/chrome/browser/notifications/stub_notification_center_mac.mm b/chrome/browser/notifications/stub_notification_center_mac.mm
index e2f7c2992e384302b4ff0015f091a235e182c298..21285ee899367854fb9f2e2917ff399d95ebd037 100644
--- a/chrome/browser/notifications/stub_notification_center_mac.mm
+++ b/chrome/browser/notifications/stub_notification_center_mac.mm
@@ -9,12 +9,12 @@
#include "chrome/browser/ui/cocoa/notifications/notification_constants_mac.h"
@implementation StubNotificationCenter {
- base::scoped_nsobject<NSMutableArray> alerts_;
+ base::scoped_nsobject<NSMutableArray> banners_;
}
- (instancetype)init {
if ((self = [super init])) {
- alerts_.reset([[NSMutableArray alloc] init]);
+ banners_.reset([[NSMutableArray alloc] init]);
}
return self;
}
@@ -29,11 +29,11 @@
}
- (void)deliverNotification:(NSUserNotification*)notification {
- [alerts_ addObject:notification];
+ [banners_ addObject:notification];
}
- (NSArray*)deliveredNotifications {
- return [[alerts_ copy] autorelease];
+ return [[banners_ copy] autorelease];
}
- (void)removeDeliveredNotification:(NSUserNotification*)notification {
@@ -43,21 +43,21 @@
objectForKey:notification_constants::kNotificationProfileId];
DCHECK(profileId);
DCHECK(notificationId);
- for (NSUserNotification* toast in alerts_.get()) {
+ for (NSUserNotification* toast in banners_.get()) {
NSString* toastId =
[toast.userInfo objectForKey:notification_constants::kNotificationId];
NSString* persistentProfileId = [toast.userInfo
objectForKey:notification_constants::kNotificationProfileId];
if ([toastId isEqualToString:notificationId] &&
[persistentProfileId isEqualToString:profileId]) {
- [alerts_ removeObject:toast];
+ [banners_ removeObject:toast];
break;
}
}
}
- (void)removeAllDeliveredNotifications {
- [alerts_ removeAllObjects];
+ [banners_ removeAllObjects];
}
// Need to provide a nop implementation of setDelegate as it is
« no previous file with comments | « chrome/browser/notifications/stub_alert_dispatcher_mac.mm ('k') | chrome/test/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698