Merge pull request #11654 from sethlu/set-notification-close-button-text
feat: Set macOS notification close button title
This commit is contained in:
commit
af92b04eb9
6 changed files with 133 additions and 21 deletions
|
@ -88,6 +88,10 @@ void CocoaNotification::Show(const NotificationOptions& options) {
|
|||
[notification_ setHasReplyButton:true];
|
||||
}
|
||||
|
||||
if (!options.close_button_text.empty()) {
|
||||
[notification_ setOtherButtonTitle:base::SysUTF16ToNSString(options.close_button_text)];
|
||||
}
|
||||
|
||||
[NSUserNotificationCenter.defaultUserNotificationCenter
|
||||
deliverNotification:notification_];
|
||||
}
|
||||
|
|
|
@ -28,13 +28,14 @@ struct NotificationOptions {
|
|||
base::string16 subtitle;
|
||||
base::string16 msg;
|
||||
std::string tag;
|
||||
bool silent;
|
||||
GURL icon_url;
|
||||
SkBitmap icon;
|
||||
bool silent;
|
||||
bool has_reply;
|
||||
base::string16 reply_placeholder;
|
||||
base::string16 sound;
|
||||
std::vector<NotificationAction> actions;
|
||||
base::string16 close_button_text;
|
||||
};
|
||||
|
||||
class Notification {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue