Bug 151951 - [GTK] Notify WebCore when notification is clicked
Summary: [GTK] Notify WebCore when notification is clicked
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Gustavo Noronha (kov)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-12-07 11:34 PST by Gustavo Noronha (kov)
Modified: 2015-12-08 00:26 PST (History)
2 users (show)

See Also:


Attachments
Patch (11.35 KB, patch)
2015-12-07 11:38 PST, Gustavo Noronha (kov)
no flags Details | Formatted Diff | Diff
Patch (12.21 KB, patch)
2015-12-07 12:43 PST, Gustavo Noronha (kov)
cgarcia: review+
cgarcia: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Gustavo Noronha (kov) 2015-12-07 11:34:15 PST
[GTK] Notify WebCore when notification is clicked
Comment 1 Gustavo Noronha (kov) 2015-12-07 11:38:03 PST
Created attachment 266793 [details]
Patch
Comment 2 Carlos Garcia Campos 2015-12-07 11:54:15 PST
Comment on attachment 266793 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=266793&action=review

Cool!

> Source/WebKit2/UIProcess/API/gtk/WebKitNotification.cpp:255
> + * webkit_notification_notify_clicked:

So, for close we have close for the method and closed for the signal, so we could probably do the same here for consistency, webkit_notification_click -> emits clicked. It's true that the notification was already clicked at this point, so maybwe could simply remove the _notify webkit_notification_clicked -> emits clicked

> Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp:624
> +        notify_notification_add_action(notification, "default", _("Acknowledge"), NOTIFY_ACTION_CALLBACK(notifyNotificationClicked), webNotification, nullptr);

What's this Acknowledge string? is that shown somewhere or just a required argument of libnotify? It it's not exposed we could probably avoid translating it.

> Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestWebKitWebView.cpp:735
> +        m_event = None;
> +        webkit_notification_notify_clicked(m_notification);
> +        // No mainloop spinning since the above will emit the signal already.

I think we should check here that onclick is emitted in js after this. So, we could od the same we do for onclose, add some js code that sends a user message back to the ui process.
Comment 3 Gustavo Noronha (kov) 2015-12-07 12:43:08 PST
Created attachment 266796 [details]
Patch
Comment 4 Carlos Garcia Campos 2015-12-07 12:54:35 PST
Comment on attachment 266796 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=266796&action=review

> Source/WebKit2/UIProcess/API/gtk/WebKitNotification.cpp:158
> +     * Emitted when a notification has been clicked. See webkit_notification_notify_clicked().

webkit_notification_notify_clicked -> webkit_notification_clicked
Comment 5 Gustavo Noronha (kov) 2015-12-08 00:26:47 PST
Committed r193721: <http://trac.webkit.org/changeset/193721>