Changeset 107068 in webkit


Ignore:
Timestamp:
Feb 8, 2012 4:13:50 AM (12 years ago)
Author:
yael.aharon@nokia.com
Message:

[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):

Location:
trunk/Source/WebKit2
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r107044 r107068  
     12012-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
    1322012-02-08  Philippe Normand  <pnormand@igalia.com>
    233
  • trunk/Source/WebKit2/UIProcess/API/C/WKNotification.cpp

    r102960 r107068  
    4848}
    4949
     50WKStringRef WKNotificationCopyIconURL(WKNotificationRef notification)
     51{
     52    return toCopiedAPI(toImpl(notification)->iconURL());
     53}
     54
    5055WKSecurityOriginRef WKNotificationGetSecurityOrigin(WKNotificationRef notification)
    5156{
  • trunk/Source/WebKit2/UIProcess/API/C/WKNotification.h

    r102960 r107068  
    3737WK_EXPORT WKStringRef WKNotificationCopyTitle(WKNotificationRef notification);
    3838WK_EXPORT WKStringRef WKNotificationCopyBody(WKNotificationRef notification);
     39WK_EXPORT WKStringRef WKNotificationCopyIconURL(WKNotificationRef notification);
    3940WK_EXPORT WKSecurityOriginRef WKNotificationGetSecurityOrigin(WKNotificationRef notification);
    4041WK_EXPORT uint64_t WKNotificationGetID(WKNotificationRef notification);
  • trunk/Source/WebKit2/UIProcess/Notifications/WebNotification.cpp

    r105364 r107068  
    3434namespace WebKit {
    3535
    36 WebNotification::WebNotification(const String& title, const String& body, const String& originString, uint64_t notificationID)
     36WebNotification::WebNotification(const String& title, const String& body, const String& iconURL, const String& originString, uint64_t notificationID)
    3737    : m_title(title)
    3838    , m_body(body)
     39    , m_iconURL(iconURL)
    3940    , m_origin(WebSecurityOrigin::createFromString(originString))
    4041    , m_notificationID(notificationID)
  • trunk/Source/WebKit2/UIProcess/Notifications/WebNotification.h

    r105364 r107068  
    4646    static const Type APIType = TypeNotification;
    4747   
    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)
    4949    {
    50         return adoptRef(new WebNotification(title, body, originString, notificationID));
     50        return adoptRef(new WebNotification(title, body, iconURL, originString, notificationID));
    5151    }
    5252   
    5353    const String& title() const { return m_title; }
    5454    const String& body() const { return m_body; }
     55    const String& iconURL() const { return m_iconURL; }
    5556    WebSecurityOrigin* origin() const { return m_origin.get(); }
    5657   
     
    5859
    5960private:
    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);
    6162
    6263    virtual Type type() const { return APIType; }
     
    6465    String m_title;
    6566    String m_body;
     67    String m_iconURL;
    6668    RefPtr<WebSecurityOrigin> m_origin;
    6769    uint64_t m_notificationID;
  • trunk/Source/WebKit2/UIProcess/Notifications/WebNotificationManagerProxy.cpp

    r106592 r107068  
    7878}
    7979
    80 void WebNotificationManagerProxy::show(WebPageProxy* page, const String& title, const String& body, const String& originString, uint64_t notificationID)
     80void WebNotificationManagerProxy::show(WebPageProxy* page, const String& title, const String& body, const String& iconURL, const String& originString, uint64_t notificationID)
    8181{
    8282    if (!isNotificationIDValid(notificationID))
    8383        return;
    8484   
    85     RefPtr<WebNotification> notification = WebNotification::create(title, body, originString, notificationID);
     85    RefPtr<WebNotification> notification = WebNotification::create(title, body, iconURL, originString, notificationID);
    8686    m_notifications.set(notificationID, notification);
    8787    m_provider.show(page, notification.get());
  • trunk/Source/WebKit2/UIProcess/Notifications/WebNotificationManagerProxy.h

    r106592 r107068  
    6161    void populateCopyOfNotificationPermissions(HashMap<String, bool>&);
    6262
    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);
    6464
    6565    void providerDidShowNotification(uint64_t notificationID);
  • trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp

    r106901 r107068  
    33783378}
    33793379
    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);
     3380void 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);
    33833383}
    33843384
  • trunk/Source/WebKit2/UIProcess/WebPageProxy.h

    r106511 r107068  
    726726
    727727    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);
    729729   
    730730#if USE(TILED_BACKING_STORE)
  • trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in

    r106492 r107068  
    207207    # Notification messages
    208208    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)
    210210
    211211    # Spelling and grammar messages
  • trunk/Source/WebKit2/WebProcess/Notifications/WebNotificationManager.cpp

    r106592 r107068  
    122122    it->second.append(notificationID);
    123123   
    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());
    125125    return true;
    126126#else
Note: See TracChangeset for help on using the changeset viewer.