Index: Source/modules/notifications/Notification.cpp |
diff --git a/Source/modules/notifications/Notification.cpp b/Source/modules/notifications/Notification.cpp |
index 72638ba4ea829c4cdff4694510ce411116331894..345859154ad543319483f292ff7e54277418d6d8 100644 |
--- a/Source/modules/notifications/Notification.cpp |
+++ b/Source/modules/notifications/Notification.cpp |
@@ -107,6 +107,12 @@ Notification* Notification::create(ExecutionContext* context, const String& titl |
notification->setIconUrl(iconUrl); |
} |
+ if (options.hasSound()) { |
+ KURL soundUrl = options.sound().isEmpty() ? KURL() : context->completeURL(options.sound()); |
+ if (!soundUrl.isEmpty() && soundUrl.isValid()) |
+ notification->setSoundUrl(soundUrl); |
+ } |
+ |
String insecureOriginMessage; |
UseCounter::Feature feature = context->isPrivilegedContext(insecureOriginMessage) |
? UseCounter::NotificationSecureOrigin |
@@ -132,6 +138,9 @@ Notification* Notification::create(ExecutionContext* context, int64_t persistent |
if (!data.icon.isEmpty()) |
notification->setIconUrl(data.icon); |
+ if (!data.sound.isEmpty()) |
+ notification->setSoundUrl(data.sound); |
+ |
if (!data.vibrate.isEmpty()) { |
NavigatorVibration::VibrationPattern pattern; |
pattern.appendRange(data.vibrate.begin(), data.vibrate.end()); |
@@ -191,7 +200,7 @@ void Notification::show() |
// they were created by, and thus the data doesn't have to be known to the embedder. |
Vector<char> emptyDataWireBytes; |
- WebNotificationData notificationData(m_title, dir, m_lang, m_body, m_tag, m_iconUrl, m_vibrate, m_silent, emptyDataWireBytes); |
+ WebNotificationData notificationData(m_title, dir, m_lang, m_body, m_tag, m_iconUrl, m_soundUrl, m_vibrate, m_silent, emptyDataWireBytes); |
notificationManager()->show(WebSerializedOrigin(*origin), notificationData, this); |
m_state = NotificationStateShowing; |