@@ -57,6 +57,7 @@ Notification::Notification(v8::Isolate* isolate,
5757 mate::Dictionary opts;
5858 if (args->GetNext (&opts)) {
5959 opts.Get (" title" , &title_);
60+ opts.Get (" subtitle" , &subtitle_);
6061 opts.Get (" body" , &body_);
6162 has_icon_ = opts.Get (" icon" , &icon_);
6263 if (has_icon_) {
@@ -88,6 +89,10 @@ base::string16 Notification::GetTitle() {
8889 return title_;
8990}
9091
92+ base::string16 Notification::GetSubtitle () {
93+ return subtitle_;
94+ }
95+
9196base::string16 Notification::GetBody () {
9297 return body_;
9398}
@@ -109,6 +114,10 @@ void Notification::SetTitle(const base::string16& new_title) {
109114 title_ = new_title;
110115}
111116
117+ void Notification::SetSubtitle (const base::string16& new_subtitle) {
118+ subtitle_ = new_subtitle;
119+ }
120+
112121void Notification::SetBody (const base::string16& new_body) {
113122 body_ = new_body;
114123}
@@ -164,6 +173,7 @@ void Notification::Show() {
164173 if (notification_) {
165174 brightray::NotificationOptions options;
166175 options.title = title_;
176+ options.subtitle = subtitle_;
167177 options.msg = body_;
168178 options.icon_url = GURL ();
169179 options.icon = icon_.AsBitmap ();
@@ -188,6 +198,8 @@ void Notification::BuildPrototype(v8::Isolate* isolate,
188198 .MakeDestroyable ()
189199 .SetMethod (" show" , &Notification::Show)
190200 .SetProperty (" title" , &Notification::GetTitle, &Notification::SetTitle)
201+ .SetProperty (" subtitle" , &Notification::GetSubtitle,
202+ &Notification::SetSubtitle)
191203 .SetProperty (" body" , &Notification::GetBody, &Notification::SetBody)
192204 .SetProperty (" silent" , &Notification::GetSilent, &Notification::SetSilent)
193205 .SetProperty (" replyPlaceholder" , &Notification::GetReplyPlaceholder,
0 commit comments