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

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

Issue 2100663002: Fix a few bugs when closing mac notifications (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 months 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
Index: chrome/browser/notifications/notification_platform_bridge_mac.mm
diff --git a/chrome/browser/notifications/notification_platform_bridge_mac.mm b/chrome/browser/notifications/notification_platform_bridge_mac.mm
index 39efa122f60a5625370714a39ef9e345542a4462..bf3644e603b7633f4df372eceae7e08b475e8e54 100644
--- a/chrome/browser/notifications/notification_platform_bridge_mac.mm
+++ b/chrome/browser/notifications/notification_platform_bridge_mac.mm
@@ -122,7 +122,8 @@ void NotificationPlatformBridgeMac::Display(const std::string& notification_id,
[notification_center deliveredNotifications]) {
NSString* identifier =
[existing_notification valueForKey:@"identifier"];
- if ([identifier isEqual:base::SysUTF8ToNSString(notification.tag())]) {
+ if ([identifier
+ isEqualToString:base::SysUTF8ToNSString(notification.tag())]) {
[notification_center
removeDeliveredNotification:existing_notification];
break;
@@ -152,9 +153,8 @@ void NotificationPlatformBridgeMac::Close(const std::string& profile_id,
NSString* persistent_profile_id = [toast.userInfo
objectForKey:notification_constants::kNotificationProfileId];
-
- if (toast_id == candidate_id &&
- persistent_profile_id == current_profile_id) {
+ if ([toast_id isEqualToString:candidate_id] &&
+ [persistent_profile_id isEqualToString:current_profile_id]) {
Peter Beverloo 2016/06/26 20:46:26 This seems like the kind of bug that would easily
Miguel Garcia 2016/06/28 08:17:20 You'd thing but in the tests all strings would be
[notification_center_ removeDeliveredNotification:toast];
}
}

Powered by Google App Engine
This is Rietveld 408576698