Plumb in the macOS soundName property for notifications.
This commit is contained in:
parent
4bc4a0c45b
commit
0cfae1cc2b
5 changed files with 20 additions and 1 deletions
|
@ -67,6 +67,7 @@ Notification::Notification(v8::Isolate* isolate,
|
|||
opts.Get("replyPlaceholder", &reply_placeholder_);
|
||||
opts.Get("hasReply", &has_reply_);
|
||||
opts.Get("actions", &actions_);
|
||||
opts.Get("soundName", &sound_name_);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -113,6 +114,10 @@ std::vector<brightray::NotificationAction> Notification::GetActions() const {
|
|||
return actions_;
|
||||
}
|
||||
|
||||
base::string16 Notification::GetSoundName() const {
|
||||
return sound_name_;
|
||||
}
|
||||
|
||||
// Setters
|
||||
void Notification::SetTitle(const base::string16& new_title) {
|
||||
title_ = new_title;
|
||||
|
@ -143,6 +148,10 @@ void Notification::SetActions(
|
|||
actions_ = actions;
|
||||
}
|
||||
|
||||
void Notification::SetSoundName(const base::string16& new_sound_name) {
|
||||
sound_name_ = new_sound_name;
|
||||
}
|
||||
|
||||
void Notification::NotificationAction(int index) {
|
||||
Emit("action", index);
|
||||
}
|
||||
|
@ -181,6 +190,7 @@ void Notification::Show() {
|
|||
options.has_reply = has_reply_;
|
||||
options.reply_placeholder = reply_placeholder_;
|
||||
options.actions = actions_;
|
||||
options.sound_name = sound_name_;
|
||||
notification_->Show(options);
|
||||
}
|
||||
}
|
||||
|
@ -207,7 +217,9 @@ void Notification::BuildPrototype(v8::Isolate* isolate,
|
|||
.SetProperty("hasReply", &Notification::GetHasReply,
|
||||
&Notification::SetHasReply)
|
||||
.SetProperty("actions", &Notification::GetActions,
|
||||
&Notification::SetActions);
|
||||
&Notification::SetActions)
|
||||
.SetProperty("soundName", &Notification::GetSoundName,
|
||||
&Notification::SetSoundName);
|
||||
}
|
||||
|
||||
} // namespace api
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue