From ba30afc383f011178d1203b37461c652043c0423 Mon Sep 17 00:00:00 2001 From: Jihye Kang Date: Thu, 11 Jul 2013 14:27:25 +0900 Subject: [PATCH] Support iconUrl of w3c Notification [Title] Support iconUrl of w3c Notification [Issue#] N/A [Problem] iconUrl of w3c Notification is not working [Cause] iconUrl is not saved when creating Notification [Solution] save iconUrl when creating Notification Change-Id: I6ed31bb94b3fb9fd71324d98a5b0e3d413c8ef76 --- Source/WebCore/Modules/notifications/Notification.cpp | 7 +++++++ Source/WebCore/Modules/notifications/Notification.h | 3 +++ 2 files changed, 10 insertions(+) diff --git a/Source/WebCore/Modules/notifications/Notification.cpp b/Source/WebCore/Modules/notifications/Notification.cpp index 348992a..ec115c0 100644 --- a/Source/WebCore/Modules/notifications/Notification.cpp +++ b/Source/WebCore/Modules/notifications/Notification.cpp @@ -153,6 +153,13 @@ PassRefPtr Notification::create(ScriptExecutionContext* context, c notification->setBody(argument); if (options.get("tag", argument)) notification->setTag(argument); +#if ENABLE(TIZEN_NOTIFICATIONS) + if (options.get("iconUrl", argument)) { + KURL iconURI = argument.isEmpty() ? KURL() : context->completeURL(argument); + if (!iconURI.isEmpty() && iconURI.isValid()) + notification->setIconURL(iconURI); + } +#endif getAndAddEventListener(eventNames().showEvent, "onshow", options, notification.get()); getAndAddEventListener(eventNames().closeEvent, "onclose", options, notification.get()); getAndAddEventListener(eventNames().errorEvent, "onerror", options, notification.get()); diff --git a/Source/WebCore/Modules/notifications/Notification.h b/Source/WebCore/Modules/notifications/Notification.h index 8de9100..92d05b2 100644 --- a/Source/WebCore/Modules/notifications/Notification.h +++ b/Source/WebCore/Modules/notifications/Notification.h @@ -90,6 +90,9 @@ public: void setURL(KURL url) { m_notificationURL = url; } KURL iconURL() const { return m_icon; } +#if ENABLE(TIZEN_NOTIFICATIONS) + void setIconURL(const KURL& url) { m_icon = url; } +#endif String title() const { return m_title; } String body() const { return m_body; } -- 2.7.4