https://bugs.webkit.org/show_bug.cgi?id=77968
Reviewed by Simon Hausmann.
Per http://www.w3.org/TR/notifications simple text notifications should have an iconURL.
Add an iconURL to WebNotification and add a public API to access it.
* UIProcess/API/C/WKNotification.cpp:
(WKNotificationCopyiconURL):
* UIProcess/API/C/WKNotification.h:
* UIProcess/Notifications/WebNotification.cpp:
(WebKit::WebNotification::WebNotification):
* UIProcess/Notifications/WebNotification.h:
(WebKit::WebNotification::create):
(WebKit::WebNotification::iconURL):
(WebNotification):
* UIProcess/Notifications/WebNotificationManagerProxy.cpp:
(WebKit::WebNotificationManagerProxy::show):
* UIProcess/Notifications/WebNotificationManagerProxy.h:
(WebNotificationManagerProxy):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::showNotification):
* UIProcess/WebPageProxy.h:
(WebPageProxy):
* UIProcess/WebPageProxy.messages.in:
* WebProcess/Notifications/WebNotificationManager.cpp:
(WebKit::WebNotificationManager::show):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@107068
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2012-02-08 Yael Aharon <yael.aharon@nokia.com>
+
+ [WK2] Text notifications should have an iconURL
+ https://bugs.webkit.org/show_bug.cgi?id=77968
+
+ Reviewed by Simon Hausmann.
+
+ Per http://www.w3.org/TR/notifications simple text notifications should have an iconURL.
+ Add an iconURL to WebNotification and add a public API to access it.
+
+ * UIProcess/API/C/WKNotification.cpp:
+ (WKNotificationCopyiconURL):
+ * UIProcess/API/C/WKNotification.h:
+ * UIProcess/Notifications/WebNotification.cpp:
+ (WebKit::WebNotification::WebNotification):
+ * UIProcess/Notifications/WebNotification.h:
+ (WebKit::WebNotification::create):
+ (WebKit::WebNotification::iconURL):
+ (WebNotification):
+ * UIProcess/Notifications/WebNotificationManagerProxy.cpp:
+ (WebKit::WebNotificationManagerProxy::show):
+ * UIProcess/Notifications/WebNotificationManagerProxy.h:
+ (WebNotificationManagerProxy):
+ * UIProcess/WebPageProxy.cpp:
+ (WebKit::WebPageProxy::showNotification):
+ * UIProcess/WebPageProxy.h:
+ (WebPageProxy):
+ * UIProcess/WebPageProxy.messages.in:
+ * WebProcess/Notifications/WebNotificationManager.cpp:
+ (WebKit::WebNotificationManager::show):
+
2012-02-08 Philippe Normand <pnormand@igalia.com>
[GTK][WK2] enable-webaudio WebSetting
return toCopiedAPI(toImpl(notification)->body());
}
+WKStringRef WKNotificationCopyIconURL(WKNotificationRef notification)
+{
+ return toCopiedAPI(toImpl(notification)->iconURL());
+}
+
WKSecurityOriginRef WKNotificationGetSecurityOrigin(WKNotificationRef notification)
{
return toAPI(toImpl(notification)->origin());
WK_EXPORT WKStringRef WKNotificationCopyTitle(WKNotificationRef notification);
WK_EXPORT WKStringRef WKNotificationCopyBody(WKNotificationRef notification);
+WK_EXPORT WKStringRef WKNotificationCopyIconURL(WKNotificationRef notification);
WK_EXPORT WKSecurityOriginRef WKNotificationGetSecurityOrigin(WKNotificationRef notification);
WK_EXPORT uint64_t WKNotificationGetID(WKNotificationRef notification);
namespace WebKit {
-WebNotification::WebNotification(const String& title, const String& body, const String& originString, uint64_t notificationID)
+WebNotification::WebNotification(const String& title, const String& body, const String& iconURL, const String& originString, uint64_t notificationID)
: m_title(title)
, m_body(body)
+ , m_iconURL(iconURL)
, m_origin(WebSecurityOrigin::createFromString(originString))
, m_notificationID(notificationID)
{
public:
static const Type APIType = TypeNotification;
- static PassRefPtr<WebNotification> create(const String& title, const String& body, const String& originString, uint64_t notificationID)
+ static PassRefPtr<WebNotification> create(const String& title, const String& body, const String& iconURL, const String& originString, uint64_t notificationID)
{
- return adoptRef(new WebNotification(title, body, originString, notificationID));
+ return adoptRef(new WebNotification(title, body, iconURL, originString, notificationID));
}
const String& title() const { return m_title; }
const String& body() const { return m_body; }
+ const String& iconURL() const { return m_iconURL; }
WebSecurityOrigin* origin() const { return m_origin.get(); }
uint64_t notificationID() const { return m_notificationID; }
private:
- WebNotification(const String& title, const String& body, const String& originString, uint64_t notificationID);
+ WebNotification(const String& title, const String& body, const String& iconURL, const String& originString, uint64_t notificationID);
virtual Type type() const { return APIType; }
String m_title;
String m_body;
+ String m_iconURL;
RefPtr<WebSecurityOrigin> m_origin;
uint64_t m_notificationID;
};
didReceiveWebNotificationManagerProxyMessage(connection, messageID, arguments);
}
-void WebNotificationManagerProxy::show(WebPageProxy* page, const String& title, const String& body, const String& originString, uint64_t notificationID)
+void WebNotificationManagerProxy::show(WebPageProxy* page, const String& title, const String& body, const String& iconURL, const String& originString, uint64_t notificationID)
{
if (!isNotificationIDValid(notificationID))
return;
- RefPtr<WebNotification> notification = WebNotification::create(title, body, originString, notificationID);
+ RefPtr<WebNotification> notification = WebNotification::create(title, body, iconURL, originString, notificationID);
m_notifications.set(notificationID, notification);
m_provider.show(page, notification.get());
}
void initializeProvider(const WKNotificationProvider*);
void populateCopyOfNotificationPermissions(HashMap<String, bool>&);
- void show(WebPageProxy*, const String& title, const String& body, const String& originString, uint64_t notificationID);
+ void show(WebPageProxy*, const String& title, const String& body, const String& iconURL, const String& originString, uint64_t notificationID);
void providerDidShowNotification(uint64_t notificationID);
void providerDidClickNotification(uint64_t notificationID);
request->deny();
}
-void WebPageProxy::showNotification(const String& title, const String& body, const String& originString, uint64_t notificationID)
+void WebPageProxy::showNotification(const String& title, const String& body, const String& iconURL, const String& originString, uint64_t notificationID)
{
- m_process->context()->notificationManagerProxy()->show(this, title, body, originString, notificationID);
+ m_process->context()->notificationManagerProxy()->show(this, title, body, iconURL, originString, notificationID);
}
float WebPageProxy::headerHeight(WebFrameProxy* frame)
void reattachToWebProcessWithItem(WebBackForwardListItem*);
void requestNotificationPermission(uint64_t notificationID, const String& originString);
- void showNotification(const String& title, const String& body, const String& originString, uint64_t notificationID);
+ void showNotification(const String& title, const String& body, const String& iconURL, const String& originString, uint64_t notificationID);
#if USE(TILED_BACKING_STORE)
void pageDidRequestScroll(const WebCore::IntPoint&);
# Notification messages
RequestNotificationPermission(uint64_t requestID, WTF::String originIdentifier)
- ShowNotification(WTF::String title, WTF::String body, WTF::String originIdentifier, uint64_t notificationID)
+ ShowNotification(WTF::String title, WTF::String body, WTF::String iconURL, WTF::String originIdentifier, uint64_t notificationID)
# Spelling and grammar messages
#if USE(UNIFIED_TEXT_CHECKING)
}
it->second.append(notificationID);
- m_process->connection()->send(Messages::WebPageProxy::ShowNotification(notification->contents().title, notification->contents().body, notification->scriptExecutionContext()->securityOrigin()->toString(), notificationID), page->pageID());
+ m_process->connection()->send(Messages::WebPageProxy::ShowNotification(notification->contents().title, notification->contents().body, notification->iconURL().string(), notification->scriptExecutionContext()->securityOrigin()->toString(), notificationID), page->pageID());
return true;
#else
return false;