Commit 576a9427 authored by Mohamed Adel's avatar Mohamed Adel Committed by Commit Bot

Removes code that was used for Chrome macOS 10.10-

On macOS versions running versions below 10.10 images did not conform to
NSSecureCoding protocol. Now that Chrome only supports macOS 10.10+ this
check is unnecessary.

Bug: None
Change-Id: Ief414b6e6e7f183b2e9e2b5065231579b92578e0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2494873Reviewed-by: default avatarRobert Sesek <rsesek@chromium.org>
Commit-Queue: Mohamed Adel <adelm@google.com>
Cr-Commit-Position: refs/heads/master@{#820321}
parent 103e3cbf
...@@ -17,13 +17,8 @@ ...@@ -17,13 +17,8 @@
if (!icon) if (!icon)
return; return;
if ([icon conformsToProtocol:@protocol(NSSecureCoding)]) { [_notificationData setObject:icon
[_notificationData setObject:icon forKey:notification_constants::kNotificationIcon];
forKey:notification_constants::kNotificationIcon];
} else { // NSImage only conforms to NSSecureCoding from 10.10 onwards.
[_notificationData setObject:[icon TIFFRepresentation]
forKey:notification_constants::kNotificationIcon];
}
} }
- (NSUserNotification*)buildUserNotification { - (NSUserNotification*)buildUserNotification {
...@@ -41,16 +36,9 @@ ...@@ -41,16 +36,9 @@
// Icon // Icon
if ([_notificationData if ([_notificationData
objectForKey:notification_constants::kNotificationIcon]) { objectForKey:notification_constants::kNotificationIcon]) {
if ([[NSImage class] conformsToProtocol:@protocol(NSSecureCoding)]) { NSImage* image = [_notificationData
NSImage* image = [_notificationData objectForKey:notification_constants::kNotificationIcon];
objectForKey:notification_constants::kNotificationIcon]; [toast setContentImage:image];
[toast setContentImage:image];
} else { // NSImage only conforms to NSSecureCoding from 10.10 onwards.
base::scoped_nsobject<NSImage> image([[NSImage alloc]
initWithData:[_notificationData objectForKey:notification_constants::
kNotificationIcon]]);
[toast setContentImage:image];
}
} }
// Type (needed to define the buttons) // Type (needed to define the buttons)
......
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