Revert "fix: Drop support for OS X Mavericks (version 10.9)" (#13333)

This commit is contained in:
Samuel Attard 2018-06-20 22:27:55 +10:00 committed by Charles Kerr
parent 562eddf0e9
commit 79fbd6bab1
15 changed files with 290 additions and 156 deletions

View file

@ -72,18 +72,24 @@ void CocoaNotification::Show(const NotificationOptions& options) {
// All of the rest are appended to the list of additional actions
NSString* actionIdentifier =
[NSString stringWithFormat:@"%@Action%d", identifier, i];
NSUserNotificationAction* notificationAction = [NSUserNotificationAction
actionWithIdentifier:actionIdentifier
title:base::SysUTF16ToNSString(action.text)];
[additionalActions addObject:notificationAction];
additional_action_indices_.insert(
std::make_pair(base::SysNSStringToUTF8(actionIdentifier), i));
if (@available(macOS 10.10, *)) {
NSUserNotificationAction* notificationAction =
[NSUserNotificationAction
actionWithIdentifier:actionIdentifier
title:base::SysUTF16ToNSString(action.text)];
[additionalActions addObject:notificationAction];
additional_action_indices_.insert(
std::make_pair(base::SysNSStringToUTF8(actionIdentifier), i));
}
}
}
i++;
}
if ([additionalActions count] > 0) {
[notification_ setAdditionalActions:additionalActions];
if ([additionalActions count] > 0 &&
[notification_ respondsToSelector:@selector(setAdditionalActions:)]) {
if (@available(macOS 10.10, *)) {
[notification_ setAdditionalActions:additionalActions];
}
}
if (options.has_reply) {