Changeset 107068 in webkit
- Timestamp:
- Feb 8, 2012 4:13:50 AM (12 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r107044 r107068 1 2012-02-08 Yael Aharon <yael.aharon@nokia.com> 2 3 [WK2] Text notifications should have an iconURL 4 https://bugs.webkit.org/show_bug.cgi?id=77968 5 6 Reviewed by Simon Hausmann. 7 8 Per http://www.w3.org/TR/notifications simple text notifications should have an iconURL. 9 Add an iconURL to WebNotification and add a public API to access it. 10 11 * UIProcess/API/C/WKNotification.cpp: 12 (WKNotificationCopyiconURL): 13 * UIProcess/API/C/WKNotification.h: 14 * UIProcess/Notifications/WebNotification.cpp: 15 (WebKit::WebNotification::WebNotification): 16 * UIProcess/Notifications/WebNotification.h: 17 (WebKit::WebNotification::create): 18 (WebKit::WebNotification::iconURL): 19 (WebNotification): 20 * UIProcess/Notifications/WebNotificationManagerProxy.cpp: 21 (WebKit::WebNotificationManagerProxy::show): 22 * UIProcess/Notifications/WebNotificationManagerProxy.h: 23 (WebNotificationManagerProxy): 24 * UIProcess/WebPageProxy.cpp: 25 (WebKit::WebPageProxy::showNotification): 26 * UIProcess/WebPageProxy.h: 27 (WebPageProxy): 28 * UIProcess/WebPageProxy.messages.in: 29 * WebProcess/Notifications/WebNotificationManager.cpp: 30 (WebKit::WebNotificationManager::show): 31 1 32 2012-02-08 Philippe Normand <pnormand@igalia.com> 2 33 -
trunk/Source/WebKit2/UIProcess/API/C/WKNotification.cpp
r102960 r107068 48 48 } 49 49 50 WKStringRef WKNotificationCopyIconURL(WKNotificationRef notification) 51 { 52 return toCopiedAPI(toImpl(notification)->iconURL()); 53 } 54 50 55 WKSecurityOriginRef WKNotificationGetSecurityOrigin(WKNotificationRef notification) 51 56 { -
trunk/Source/WebKit2/UIProcess/API/C/WKNotification.h
r102960 r107068 37 37 WK_EXPORT WKStringRef WKNotificationCopyTitle(WKNotificationRef notification); 38 38 WK_EXPORT WKStringRef WKNotificationCopyBody(WKNotificationRef notification); 39 WK_EXPORT WKStringRef WKNotificationCopyIconURL(WKNotificationRef notification); 39 40 WK_EXPORT WKSecurityOriginRef WKNotificationGetSecurityOrigin(WKNotificationRef notification); 40 41 WK_EXPORT uint64_t WKNotificationGetID(WKNotificationRef notification); -
trunk/Source/WebKit2/UIProcess/Notifications/WebNotification.cpp
r105364 r107068 34 34 namespace WebKit { 35 35 36 WebNotification::WebNotification(const String& title, const String& body, const String& originString, uint64_t notificationID)36 WebNotification::WebNotification(const String& title, const String& body, const String& iconURL, const String& originString, uint64_t notificationID) 37 37 : m_title(title) 38 38 , m_body(body) 39 , m_iconURL(iconURL) 39 40 , m_origin(WebSecurityOrigin::createFromString(originString)) 40 41 , m_notificationID(notificationID) -
trunk/Source/WebKit2/UIProcess/Notifications/WebNotification.h
r105364 r107068 46 46 static const Type APIType = TypeNotification; 47 47 48 static PassRefPtr<WebNotification> create(const String& title, const String& body, const String& originString, uint64_t notificationID)48 static PassRefPtr<WebNotification> create(const String& title, const String& body, const String& iconURL, const String& originString, uint64_t notificationID) 49 49 { 50 return adoptRef(new WebNotification(title, body, originString, notificationID));50 return adoptRef(new WebNotification(title, body, iconURL, originString, notificationID)); 51 51 } 52 52 53 53 const String& title() const { return m_title; } 54 54 const String& body() const { return m_body; } 55 const String& iconURL() const { return m_iconURL; } 55 56 WebSecurityOrigin* origin() const { return m_origin.get(); } 56 57 … … 58 59 59 60 private: 60 WebNotification(const String& title, const String& body, const String& originString, uint64_t notificationID);61 WebNotification(const String& title, const String& body, const String& iconURL, const String& originString, uint64_t notificationID); 61 62 62 63 virtual Type type() const { return APIType; } … … 64 65 String m_title; 65 66 String m_body; 67 String m_iconURL; 66 68 RefPtr<WebSecurityOrigin> m_origin; 67 69 uint64_t m_notificationID; -
trunk/Source/WebKit2/UIProcess/Notifications/WebNotificationManagerProxy.cpp
r106592 r107068 78 78 } 79 79 80 void WebNotificationManagerProxy::show(WebPageProxy* page, const String& title, const String& body, const String& originString, uint64_t notificationID)80 void WebNotificationManagerProxy::show(WebPageProxy* page, const String& title, const String& body, const String& iconURL, const String& originString, uint64_t notificationID) 81 81 { 82 82 if (!isNotificationIDValid(notificationID)) 83 83 return; 84 84 85 RefPtr<WebNotification> notification = WebNotification::create(title, body, originString, notificationID);85 RefPtr<WebNotification> notification = WebNotification::create(title, body, iconURL, originString, notificationID); 86 86 m_notifications.set(notificationID, notification); 87 87 m_provider.show(page, notification.get()); -
trunk/Source/WebKit2/UIProcess/Notifications/WebNotificationManagerProxy.h
r106592 r107068 61 61 void populateCopyOfNotificationPermissions(HashMap<String, bool>&); 62 62 63 void show(WebPageProxy*, const String& title, const String& body, const String& originString, uint64_t notificationID);63 void show(WebPageProxy*, const String& title, const String& body, const String& iconURL, const String& originString, uint64_t notificationID); 64 64 65 65 void providerDidShowNotification(uint64_t notificationID); -
trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp
r106901 r107068 3378 3378 } 3379 3379 3380 void WebPageProxy::showNotification(const String& title, const String& body, const String& originString, uint64_t notificationID)3381 { 3382 m_process->context()->notificationManagerProxy()->show(this, title, body, originString, notificationID);3380 void WebPageProxy::showNotification(const String& title, const String& body, const String& iconURL, const String& originString, uint64_t notificationID) 3381 { 3382 m_process->context()->notificationManagerProxy()->show(this, title, body, iconURL, originString, notificationID); 3383 3383 } 3384 3384 -
trunk/Source/WebKit2/UIProcess/WebPageProxy.h
r106511 r107068 726 726 727 727 void requestNotificationPermission(uint64_t notificationID, const String& originString); 728 void showNotification(const String& title, const String& body, const String& originString, uint64_t notificationID);728 void showNotification(const String& title, const String& body, const String& iconURL, const String& originString, uint64_t notificationID); 729 729 730 730 #if USE(TILED_BACKING_STORE) -
trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in
r106492 r107068 207 207 # Notification messages 208 208 RequestNotificationPermission(uint64_t requestID, WTF::String originIdentifier) 209 ShowNotification(WTF::String title, WTF::String body, WTF::String originIdentifier, uint64_t notificationID)209 ShowNotification(WTF::String title, WTF::String body, WTF::String iconURL, WTF::String originIdentifier, uint64_t notificationID) 210 210 211 211 # Spelling and grammar messages -
trunk/Source/WebKit2/WebProcess/Notifications/WebNotificationManager.cpp
r106592 r107068 122 122 it->second.append(notificationID); 123 123 124 m_process->connection()->send(Messages::WebPageProxy::ShowNotification(notification->contents().title, notification->contents().body, notification-> scriptExecutionContext()->securityOrigin()->toString(), notificationID), page->pageID());124 m_process->connection()->send(Messages::WebPageProxy::ShowNotification(notification->contents().title, notification->contents().body, notification->iconURL().string(), notification->scriptExecutionContext()->securityOrigin()->toString(), notificationID), page->pageID()); 125 125 return true; 126 126 #else
Note: See TracChangeset
for help on using the changeset viewer.