Support iconUrl of w3c Notification
authorJihye Kang <jye.kang@samsung.com>
Thu, 11 Jul 2013 05:27:25 +0000 (14:27 +0900)
committerGerrit Code Review <gerrit@gerrit.vlan144.tizendev.org>
Thu, 11 Jul 2013 11:10:23 +0000 (11:10 +0000)
[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
Source/WebCore/Modules/notifications/Notification.h

index 348992a..ec115c0 100644 (file)
@@ -153,6 +153,13 @@ PassRefPtr<Notification> Notification::create(ScriptExecutionContext* context, c
         notification->setBody(argument);
     if (options.get("tag", argument))
         notification->setTag(argument);
         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());
     getAndAddEventListener(eventNames().showEvent, "onshow", options, notification.get());
     getAndAddEventListener(eventNames().closeEvent, "onclose", options, notification.get());
     getAndAddEventListener(eventNames().errorEvent, "onerror", options, notification.get());
index 8de9100..92d05b2 100644 (file)
@@ -90,6 +90,9 @@ public:
     void setURL(KURL url) { m_notificationURL = url; }
     
     KURL iconURL() const { return m_icon; }
     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; }
 
     String title() const { return m_title; }
     String body() const { return m_body; }