<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[177073] trunk</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/177073">177073</a></dd>
<dt>Author</dt> <dd>gns@gnome.org</dd>
<dt>Date</dt> <dd>2014-12-10 09:36:40 -0800 (Wed, 10 Dec 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>[GTK][WK2] Add HTML5 Notifications support
https://bugs.webkit.org/show_bug.cgi?id=61140
.:
Patch by Gustavo Noronha Silva <gustavo.noronha@collabora.com> on 2014-12-09
Reviewed by Carlos Garcia Campos.
* Source/cmake/FindLibNotify.cmake: Added.
* Source/cmake/OptionsGTK.cmake: add option to enable notifications, look for
libnotify and use it for a default implementation when found.
Source/WebKit2:
Patch by Claudio Saavedra <csaavedra@igalia.com> and Gustavo Noronha Silva <gustavo.noronha@collabora.com> on 2014-12-09
Reviewed by Carlos Garcia Campos.
* PlatformGTK.cmake: add new files to the build.
* UIProcess/API/gtk/WebKitForwardDeclarations.h:
* UIProcess/API/gtk/WebKitNotification.cpp: Added. New GObject used to expose information about
the notification to the API.
(webkitNotificationGetProperty):
(webkit_notification_class_init):
(webkitNotificationCreate):
(webkit_notification_get_id):
(webkit_notification_get_title):
(webkit_notification_get_body):
* UIProcess/API/gtk/WebKitNotification.h: Added.
* UIProcess/API/gtk/WebKitNotificationPermissionRequest.cpp: Added. Permission request object
for notifications.
(webkitNotificationPermissionRequestAllow):
(webkitNotificationPermissionRequestDeny):
(webkit_permission_request_interface_init):
(webkitNotificationPermissionRequestDispose):
(webkit_notification_permission_request_class_init):
(webkitNotificationPermissionRequestCreate):
* UIProcess/API/gtk/WebKitNotificationPermissionRequest.h: Added.
* UIProcess/API/gtk/WebKitNotificationPermissionRequestPrivate.h: Added.
* UIProcess/API/gtk/WebKitNotificationPrivate.h: Added.
* UIProcess/API/gtk/WebKitNotificationProvider.cpp: Added. Notification provider that emits signals.
The C API allows overriding the notification providers and managers for customizing the handling of
notifications. We decided to go for a single manager and a single provider which provide more idiomatic
GObject API - signals.
(toNotificationProvider):
(showCallback):
(cancelCallback):
(WebKitNotificationProvider::~WebKitNotificationProvider):
(WebKitNotificationProvider::create):
(WebKitNotificationProvider::WebKitNotificationProvider):
(WebKitNotificationProvider::show):
(WebKitNotificationProvider::cancel):
* UIProcess/API/gtk/WebKitNotificationProvider.h: Added.
* UIProcess/API/gtk/WebKitUIClient.cpp: implemented decidePolicyForNotificationPermissionRequest.
* UIProcess/API/gtk/WebKitWebContext.cpp:
(webkitWebContextConstructed): initialize the notification provider.
* UIProcess/API/gtk/WebKitWebView.cpp:
(webkitWebViewShowNotification): default implementation for showing the notification, currently
using GNotification, about to be ported to libnotify.
(webkit_web_view_class_init): set the default implementation for the show-notification signal.
(webkitWebViewEmitCloseNotification): emit the close-notification signal.
(webkitWebViewEmitShowNotification): emit the show-notification signal.
* UIProcess/API/gtk/WebKitWebView.h:
* UIProcess/API/gtk/WebKitWebViewPrivate.h:
* UIProcess/API/gtk/docs/webkit2gtk-sections.txt: list new objects and methods.
* UIProcess/API/gtk/webkit2.h: include new headers.
Tools:
Patch by Gustavo Noronha Silva <gustavo.noronha@collabora.com> on 2014-12-09
Reviewed by Carlos Garcia Campos.
* Scripts/webkitperl/FeatureList.pm: enable notifications for GTK+.
* TestWebKitAPI/Tests/WebKit2Gtk/TestWebKitWebView.cpp:
(testWebViewNotification):
(beforeAll):
* MiniBrowser/gtk/BrowserWindow.c: also handle notification permission requests.
(permissionRequestDialogCallback):
(webViewDecidePermissionRequest):
(geolocationRequestDialogCallback): Deleted.
LayoutTests:
Patch by Gustavo Noronha Silva <gustavo.noronha@collabora.com> on 2014-12-09
Reviewed by Carlos Garcia Campos.
* platform/gtk/TestExpectations: unskip the HTTP tests for new-style notifications.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkChangeLog">trunk/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsplatformgtkTestExpectations">trunk/LayoutTests/platform/gtk/TestExpectations</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2PlatformGTKcmake">trunk/Source/WebKit2/PlatformGTK.cmake</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIgtkWebKitForwardDeclarationsh">trunk/Source/WebKit2/UIProcess/API/gtk/WebKitForwardDeclarations.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIgtkWebKitUIClientcpp">trunk/Source/WebKit2/UIProcess/API/gtk/WebKitUIClient.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIgtkWebKitWebContextcpp">trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIgtkWebKitWebViewcpp">trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIgtkWebKitWebViewh">trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebView.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIgtkWebKitWebViewPrivateh">trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewPrivate.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIgtkdocswebkit2gtksectionstxt">trunk/Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-sections.txt</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIgtkwebkit2h">trunk/Source/WebKit2/UIProcess/API/gtk/webkit2.h</a></li>
<li><a href="#trunkSourcecmakeOptionsGTKcmake">trunk/Source/cmake/OptionsGTK.cmake</a></li>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsMiniBrowsergtkBrowserWindowc">trunk/Tools/MiniBrowser/gtk/BrowserWindow.c</a></li>
<li><a href="#trunkToolsScriptswebkitperlFeatureListpm">trunk/Tools/Scripts/webkitperl/FeatureList.pm</a></li>
<li><a href="#trunkToolsTestWebKitAPITestsWebKit2GtkTestWebKitWebViewcpp">trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestWebKitWebView.cpp</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2UIProcessAPIgtkWebKitNotificationcpp">trunk/Source/WebKit2/UIProcess/API/gtk/WebKitNotification.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIgtkWebKitNotificationh">trunk/Source/WebKit2/UIProcess/API/gtk/WebKitNotification.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIgtkWebKitNotificationPermissionRequestcpp">trunk/Source/WebKit2/UIProcess/API/gtk/WebKitNotificationPermissionRequest.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIgtkWebKitNotificationPermissionRequesth">trunk/Source/WebKit2/UIProcess/API/gtk/WebKitNotificationPermissionRequest.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIgtkWebKitNotificationPermissionRequestPrivateh">trunk/Source/WebKit2/UIProcess/API/gtk/WebKitNotificationPermissionRequestPrivate.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIgtkWebKitNotificationPrivateh">trunk/Source/WebKit2/UIProcess/API/gtk/WebKitNotificationPrivate.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIgtkWebKitNotificationProvidercpp">trunk/Source/WebKit2/UIProcess/API/gtk/WebKitNotificationProvider.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIgtkWebKitNotificationProviderh">trunk/Source/WebKit2/UIProcess/API/gtk/WebKitNotificationProvider.h</a></li>
<li><a href="#trunkSourcecmakeFindLibNotifycmake">trunk/Source/cmake/FindLibNotify.cmake</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/ChangeLog (177072 => 177073)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/ChangeLog        2014-12-10 17:12:28 UTC (rev 177072)
+++ trunk/ChangeLog        2014-12-10 17:36:40 UTC (rev 177073)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2014-12-09 Gustavo Noronha Silva <gustavo.noronha@collabora.com>
+
+ [GTK][WK2] Add HTML5 Notifications support
+ https://bugs.webkit.org/show_bug.cgi?id=61140
+
+ Reviewed by Carlos Garcia Campos.
+
+ * Source/cmake/FindLibNotify.cmake: Added.
+ * Source/cmake/OptionsGTK.cmake: add option to enable notifications, look for
+ libnotify and use it for a default implementation when found.
+
</ins><span class="cx"> 2014-12-09 Bem Jones-Bey <bjonesbe@adobe.com>
</span><span class="cx">
</span><span class="cx"> REGRESSION(r155906): Page content disappears on Tuaw article after loading
</span></span></pre></div>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (177072 => 177073)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2014-12-10 17:12:28 UTC (rev 177072)
+++ trunk/LayoutTests/ChangeLog        2014-12-10 17:36:40 UTC (rev 177073)
</span><span class="lines">@@ -1,3 +1,12 @@
</span><ins>+2014-12-09 Gustavo Noronha Silva <gustavo.noronha@collabora.com>
+
+ [GTK][WK2] Add HTML5 Notifications support
+ https://bugs.webkit.org/show_bug.cgi?id=61140
+
+ Reviewed by Carlos Garcia Campos.
+
+ * platform/gtk/TestExpectations: unskip the HTTP tests for new-style notifications.
+
</ins><span class="cx"> 2014-12-09 Alexey Proskuryakov <ap@apple.com>
</span><span class="cx">
</span><span class="cx"> Unskip more multipart tests
</span></span></pre></div>
<a id="trunkLayoutTestsplatformgtkTestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/gtk/TestExpectations (177072 => 177073)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/gtk/TestExpectations        2014-12-10 17:12:28 UTC (rev 177072)
+++ trunk/LayoutTests/platform/gtk/TestExpectations        2014-12-10 17:36:40 UTC (rev 177073)
</span><span class="lines">@@ -146,10 +146,17 @@
</span><span class="cx"> webkit.org/b/98927 fast/dom/DeviceMotion [ Skip ]
</span><span class="cx"> webkit.org/b/98927 fast/dom/DeviceOrientation [ Skip ]
</span><span class="cx">
</span><del>-# Desktop notifications are not yet supported.
-webkit.org/b/61140 fast/notifications [ Skip ]
-webkit.org/b/61140 http/tests/notifications [ Skip ]
</del><ins>+# https://bugs.webkit.org/show_bug.cgi?id=81697 Skip file:// based notifications tests
+fast/notifications
</ins><span class="cx">
</span><ins>+# we do not enable legacy notifications
+http/tests/notifications/legacy/window-show-on-click.html
+http/tests/notifications/legacy/request.html
+http/tests/notifications/legacy/request-no-callback.html
+http/tests/notifications/legacy/events.html
+http/tests/notifications/legacy/show.html
+http/tests/notifications/legacy/double-show.html
+
</ins><span class="cx"> # StorageTracker is not enabled.
</span><span class="cx"> webkit.org/b/98933 storage/domstorage/localstorage/storagetracker [ Skip ]
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (177072 => 177073)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2014-12-10 17:12:28 UTC (rev 177072)
+++ trunk/Source/WebKit2/ChangeLog        2014-12-10 17:36:40 UTC (rev 177073)
</span><span class="lines">@@ -1,3 +1,59 @@
</span><ins>+2014-12-09 Claudio Saavedra <csaavedra@igalia.com> and Gustavo Noronha Silva <gustavo.noronha@collabora.com>
+
+ [GTK][WK2] Add HTML5 Notifications support
+ https://bugs.webkit.org/show_bug.cgi?id=61140
+
+ Reviewed by Carlos Garcia Campos.
+
+ * PlatformGTK.cmake: add new files to the build.
+ * UIProcess/API/gtk/WebKitForwardDeclarations.h:
+ * UIProcess/API/gtk/WebKitNotification.cpp: Added. New GObject used to expose information about
+ the notification to the API.
+ (webkitNotificationGetProperty):
+ (webkit_notification_class_init):
+ (webkitNotificationCreate):
+ (webkit_notification_get_id):
+ (webkit_notification_get_title):
+ (webkit_notification_get_body):
+ * UIProcess/API/gtk/WebKitNotification.h: Added.
+ * UIProcess/API/gtk/WebKitNotificationPermissionRequest.cpp: Added. Permission request object
+ for notifications.
+ (webkitNotificationPermissionRequestAllow):
+ (webkitNotificationPermissionRequestDeny):
+ (webkit_permission_request_interface_init):
+ (webkitNotificationPermissionRequestDispose):
+ (webkit_notification_permission_request_class_init):
+ (webkitNotificationPermissionRequestCreate):
+ * UIProcess/API/gtk/WebKitNotificationPermissionRequest.h: Added.
+ * UIProcess/API/gtk/WebKitNotificationPermissionRequestPrivate.h: Added.
+ * UIProcess/API/gtk/WebKitNotificationPrivate.h: Added.
+ * UIProcess/API/gtk/WebKitNotificationProvider.cpp: Added. Notification provider that emits signals.
+ The C API allows overriding the notification providers and managers for customizing the handling of
+ notifications. We decided to go for a single manager and a single provider which provide more idiomatic
+ GObject API - signals.
+ (toNotificationProvider):
+ (showCallback):
+ (cancelCallback):
+ (WebKitNotificationProvider::~WebKitNotificationProvider):
+ (WebKitNotificationProvider::create):
+ (WebKitNotificationProvider::WebKitNotificationProvider):
+ (WebKitNotificationProvider::show):
+ (WebKitNotificationProvider::cancel):
+ * UIProcess/API/gtk/WebKitNotificationProvider.h: Added.
+ * UIProcess/API/gtk/WebKitUIClient.cpp: implemented decidePolicyForNotificationPermissionRequest.
+ * UIProcess/API/gtk/WebKitWebContext.cpp:
+ (webkitWebContextConstructed): initialize the notification provider.
+ * UIProcess/API/gtk/WebKitWebView.cpp:
+ (webkitWebViewShowNotification): default implementation for showing the notification, currently
+ using GNotification, about to be ported to libnotify.
+ (webkit_web_view_class_init): set the default implementation for the show-notification signal.
+ (webkitWebViewEmitCloseNotification): emit the close-notification signal.
+ (webkitWebViewEmitShowNotification): emit the show-notification signal.
+ * UIProcess/API/gtk/WebKitWebView.h:
+ * UIProcess/API/gtk/WebKitWebViewPrivate.h:
+ * UIProcess/API/gtk/docs/webkit2gtk-sections.txt: list new objects and methods.
+ * UIProcess/API/gtk/webkit2.h: include new headers.
+
</ins><span class="cx"> 2014-12-10 Grzegorz Czajkowski <g.czajkowski@samsung.com>
</span><span class="cx">
</span><span class="cx"> [EFL][[WK2] test_ewk2_text_checker is failed
</span></span></pre></div>
<a id="trunkSourceWebKit2PlatformGTKcmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/PlatformGTK.cmake (177072 => 177073)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/PlatformGTK.cmake        2014-12-10 17:12:28 UTC (rev 177072)
+++ trunk/Source/WebKit2/PlatformGTK.cmake        2014-12-10 17:36:40 UTC (rev 177073)
</span><span class="lines">@@ -158,6 +158,14 @@
</span><span class="cx"> UIProcess/API/gtk/WebKitNavigationPolicyDecision.cpp
</span><span class="cx"> UIProcess/API/gtk/WebKitNavigationPolicyDecision.h
</span><span class="cx"> UIProcess/API/gtk/WebKitNavigationPolicyDecisionPrivate.h
</span><ins>+ UIProcess/API/gtk/WebKitNotificationPermissionRequest.cpp
+ UIProcess/API/gtk/WebKitNotificationPermissionRequest.h
+ UIProcess/API/gtk/WebKitNotificationPermissionRequestPrivate.h
+ UIProcess/API/gtk/WebKitNotificationProvider.cpp
+ UIProcess/API/gtk/WebKitNotificationProvider.h
+ UIProcess/API/gtk/WebKitNotification.cpp
+ UIProcess/API/gtk/WebKitNotification.h
+ UIProcess/API/gtk/WebKitNotificationPrivate.h
</ins><span class="cx"> UIProcess/API/gtk/WebKitPermissionRequest.cpp
</span><span class="cx"> UIProcess/API/gtk/WebKitPermissionRequest.h
</span><span class="cx"> UIProcess/API/gtk/WebKitPlugin.cpp
</span><span class="lines">@@ -351,6 +359,8 @@
</span><span class="cx"> ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitMimeInfo.h
</span><span class="cx"> ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitNavigationAction.h
</span><span class="cx"> ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitNavigationPolicyDecision.h
</span><ins>+ ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitNotificationPermissionRequest.h
+ ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitNotification.h
</ins><span class="cx"> ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitPermissionRequest.h
</span><span class="cx"> ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitPlugin.h
</span><span class="cx"> ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitPolicyDecision.h
</span><span class="lines">@@ -455,6 +465,12 @@
</span><span class="cx"> ${LIBSOUP_INCLUDE_DIRS}
</span><span class="cx"> )
</span><span class="cx">
</span><ins>+if (LIBNOTIFY_FOUND)
+list(APPEND WebKit2_INCLUDE_DIRECTORIES
+ ${LIBNOTIFY_INCLUDE_DIRS}
+)
+endif ()
+
</ins><span class="cx"> set(WebKit2CommonIncludeDirectories ${WebKit2_INCLUDE_DIRECTORIES})
</span><span class="cx">
</span><span class="cx"> list(APPEND WebKit2_INCLUDE_DIRECTORIES
</span><span class="lines">@@ -489,6 +505,13 @@
</span><span class="cx"> WebCorePlatformGTK
</span><span class="cx"> ${GTK_UNIX_PRINT_LIBRARIES}
</span><span class="cx"> )
</span><ins>+
+if (LIBNOTIFY_FOUND)
+list(APPEND WebKit2_LIBRARIES
+ ${LIBNOTIFY_LIBRARIES}
+)
+endif ()
+
</ins><span class="cx"> ADD_WHOLE_ARCHIVE_TO_LIBRARIES(WebKit2_LIBRARIES)
</span><span class="cx">
</span><span class="cx"> set(WebKit2_MARSHAL_LIST ${WEBKIT2_DIR}/UIProcess/API/gtk/webkit2marshal.list)
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIgtkWebKitForwardDeclarationsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/gtk/WebKitForwardDeclarations.h (177072 => 177073)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/gtk/WebKitForwardDeclarations.h        2014-12-10 17:12:28 UTC (rev 177072)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/WebKitForwardDeclarations.h        2014-12-10 17:36:40 UTC (rev 177073)
</span><span class="lines">@@ -35,5 +35,6 @@
</span><span class="cx"> typedef struct _WebKitWebView WebKitWebView;
</span><span class="cx"> typedef struct _WebKitContextMenu WebKitContextMenu;
</span><span class="cx"> typedef struct _WebKitContextMenuItem WebKitContextMenuItem;
</span><ins>+typedef struct _WebKitNotification WebKitNotification;
</ins><span class="cx">
</span><span class="cx"> #endif // WebKitForward_h
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIgtkWebKitNotificationcpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit2/UIProcess/API/gtk/WebKitNotification.cpp (0 => 177073)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/gtk/WebKitNotification.cpp         (rev 0)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/WebKitNotification.cpp        2014-12-10 17:36:40 UTC (rev 177073)
</span><span class="lines">@@ -0,0 +1,189 @@
</span><ins>+/*
+ * Copyright (C) 2014 Collabora Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "config.h"
+#include "WebKitNotification.h"
+
+#include "WebKitNotificationPrivate.h"
+#include "WebKitPrivate.h"
+#include "WebNotification.h"
+#include <glib/gi18n-lib.h>
+#include <wtf/text/CString.h>
+
+/**
+ * SECTION: WebKitNotification
+ * @Short_description: Object used to hold information about a notification that should be shown to the user.
+ * @Title: WebKitNotification
+ *
+ * Since: 2.8
+ */
+
+enum {
+ PROP_0,
+
+ PROP_ID,
+ PROP_TITLE,
+ PROP_BODY
+};
+
+struct _WebKitNotificationPrivate {
+ CString title;
+ CString body;
+ guint64 id;
+
+ WebKitWebView* webView;
+};
+
+WEBKIT_DEFINE_TYPE(WebKitNotification, webkit_notification, G_TYPE_OBJECT)
+
+static void webkitNotificationGetProperty(GObject* object, guint propId, GValue* value, GParamSpec* paramSpec)
+{
+ WebKitNotification* notification = WEBKIT_NOTIFICATION(object);
+
+ switch (propId) {
+ case PROP_ID:
+ g_value_set_uint64(value, webkit_notification_get_id(notification));
+ break;
+ case PROP_TITLE:
+ g_value_set_string(value, webkit_notification_get_title(notification));
+ break;
+ case PROP_BODY:
+ g_value_set_string(value, webkit_notification_get_body(notification));
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID(object, propId, paramSpec);
+ }
+}
+
+static void webkit_notification_class_init(WebKitNotificationClass* notificationClass)
+{
+ GObjectClass* objectClass = G_OBJECT_CLASS(notificationClass);
+ objectClass->get_property = webkitNotificationGetProperty;
+
+ /**
+ * WebKitNotification:id:
+ *
+ * The unique id for the notification.
+ *
+ * Since: 2.8
+ */
+ g_object_class_install_property(objectClass,
+ PROP_ID,
+ g_param_spec_uint64("id",
+ _("ID"),
+ _("The unique id for the notification"),
+ 0, G_MAXUINT64, 0,
+ WEBKIT_PARAM_READABLE));
+
+ /**
+ * WebKitNotification:title:
+ *
+ * The title for the notification.
+ *
+ * Since: 2.8
+ */
+ g_object_class_install_property(objectClass,
+ PROP_TITLE,
+ g_param_spec_string("title",
+ _("Title"),
+ _("The title for the notification"),
+ nullptr,
+ WEBKIT_PARAM_READABLE));
+
+ /**
+ * WebKitNotification:body:
+ *
+ * The body for the notification.
+ *
+ * Since: 2.8
+ */
+ g_object_class_install_property(objectClass,
+ PROP_BODY,
+ g_param_spec_string("body",
+ _("Body"),
+ _("The body for the notification"),
+ nullptr,
+ WEBKIT_PARAM_READABLE));
+}
+
+WebKitNotification* webkitNotificationCreate(WebKitWebView* webView, const WebKit::WebNotification& webNotification)
+{
+ WebKitNotification* notification = WEBKIT_NOTIFICATION(g_object_new(WEBKIT_TYPE_NOTIFICATION, nullptr));
+ notification->priv->id = webNotification.notificationID();
+ notification->priv->title = webNotification.title().utf8();
+ notification->priv->body = webNotification.body().utf8();
+ notification->priv->webView = webView;
+ return notification;
+}
+
+WebKitWebView* webkitNotificationGetWebView(WebKitNotification* notification)
+{
+ return notification->priv->webView;
+}
+
+/**
+ * webkit_notification_get_id:
+ * @notification: a #WebKitNotification
+ *
+ * Obtains the unique id for the notification.
+ *
+ * Returns: the unique id for the notification
+ *
+ * Since: 2.8
+ */
+guint64 webkit_notification_get_id(WebKitNotification* notification)
+{
+ g_return_val_if_fail(WEBKIT_IS_NOTIFICATION(notification), 0);
+
+ return notification->priv->id;
+}
+
+/**
+ * webkit_notification_get_title:
+ * @notification: a #WebKitNotification
+ *
+ * Obtains the title for the notification.
+ *
+ * Returns: the title for the notification
+ *
+ * Since: 2.8
+ */
+const gchar* webkit_notification_get_title(WebKitNotification* notification)
+{
+ g_return_val_if_fail(WEBKIT_IS_NOTIFICATION(notification), nullptr);
+
+ return notification->priv->title.data();
+}
+
+/**
+ * webkit_notification_get_body:
+ * @notification: a #WebKitNotification
+ *
+ * Obtains the body for the notification.
+ *
+ * Returns: the body for the notification
+ *
+ * Since: 2.8
+ */
+const gchar* webkit_notification_get_body(WebKitNotification* notification)
+{
+ g_return_val_if_fail(WEBKIT_IS_NOTIFICATION(notification), nullptr);
+
+ return notification->priv->body.data();
+}
</ins></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIgtkWebKitNotificationh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit2/UIProcess/API/gtk/WebKitNotification.h (0 => 177073)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/gtk/WebKitNotification.h         (rev 0)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/WebKitNotification.h        2014-12-10 17:36:40 UTC (rev 177073)
</span><span class="lines">@@ -0,0 +1,75 @@
</span><ins>+/*
+ * Copyright (C) 2014 Collabora Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#if !defined(__WEBKIT2_H_INSIDE__) && !defined(WEBKIT2_COMPILATION)
+#error "Only <webkit2/webkit2.h> can be included directly."
+#endif
+
+#ifndef WebKitNotification_h
+#define WebKitNotification_h
+
+#include <glib-object.h>
+#include <webkit2/WebKitDefines.h>
+#include <webkit2/WebKitForwardDeclarations.h>
+
+G_BEGIN_DECLS
+
+#define WEBKIT_TYPE_NOTIFICATION (webkit_notification_get_type())
+#define WEBKIT_NOTIFICATION(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), WEBKIT_TYPE_NOTIFICATION, WebKitNotification))
+#define WEBKIT_IS_NOTIFICATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), WEBKIT_TYPE_NOTIFICATION))
+#define WEBKIT_NOTIFICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), WEBKIT_TYPE_NOTIFICATION, WebKitNotificationClass))
+#define WEBKIT_IS_NOTIFICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), WEBKIT_TYPE_NOTIFICATION))
+#define WEBKIT_NOTIFICATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), WEBKIT_TYPE_NOTIFICATION, WebKitNotificationClass))
+
+typedef struct _WebKitNotification WebKitNotification;
+typedef struct _WebKitNotificationClass WebKitNotificationClass;
+typedef struct _WebKitNotificationPrivate WebKitNotificationPrivate;
+
+struct _WebKitNotification {
+ GObject parent;
+
+ WebKitNotificationPrivate *priv;
+};
+
+struct _WebKitNotificationClass {
+ GObjectClass parent_class;
+
+ void (*_webkit_reserved0) (void);
+ void (*_webkit_reserved1) (void);
+ void (*_webkit_reserved2) (void);
+ void (*_webkit_reserved3) (void);
+ void (*_webkit_reserved4) (void);
+ void (*_webkit_reserved5) (void);
+};
+
+WEBKIT_API GType
+webkit_notification_get_type (void);
+
+WEBKIT_API guint64
+webkit_notification_get_id (WebKitNotification *notification);
+
+WEBKIT_API const gchar *
+webkit_notification_get_title (WebKitNotification *notification);
+
+WEBKIT_API const gchar *
+webkit_notification_get_body (WebKitNotification *notification);
+
+G_END_DECLS
+
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIgtkWebKitNotificationPermissionRequestcpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit2/UIProcess/API/gtk/WebKitNotificationPermissionRequest.cpp (0 => 177073)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/gtk/WebKitNotificationPermissionRequest.cpp         (rev 0)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/WebKitNotificationPermissionRequest.cpp        2014-12-10 17:36:40 UTC (rev 177073)
</span><span class="lines">@@ -0,0 +1,103 @@
</span><ins>+/*
+ * Copyright (C) 2013 Igalia S.L.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "config.h"
+#include "WebKitNotificationPermissionRequest.h"
+
+#include "NotificationPermissionRequest.h"
+#include "WebKitNotificationPermissionRequestPrivate.h"
+#include "WebKitPermissionRequest.h"
+
+using namespace WebKit;
+
+/**
+ * SECTION: WebKitNotificationPermissionRequest
+ * @Short_description: A permission request for displaying web notifications
+ * @Title: WebKitNotificationPermissionRequest
+ * @See_also: #WebKitPermissionRequest, #WebKitWebView
+ *
+ * WebKitNotificationPermissionRequest represents a request for
+ * permission to decide whether WebKit should provide the user with
+ * notifications through the Web Notification API.
+ */
+
+static void webkit_permission_request_interface_init(WebKitPermissionRequestIface*);
+
+struct _WebKitNotificationPermissionRequestPrivate {
+ RefPtr<NotificationPermissionRequest> request;
+ bool madeDecision;
+};
+
+WEBKIT_DEFINE_TYPE_WITH_CODE(
+ WebKitNotificationPermissionRequest, webkit_notification_permission_request, G_TYPE_OBJECT,
+ G_IMPLEMENT_INTERFACE(WEBKIT_TYPE_PERMISSION_REQUEST, webkit_permission_request_interface_init))
+
+static void webkitNotificationPermissionRequestAllow(WebKitPermissionRequest* request)
+{
+ ASSERT(WEBKIT_IS_NOTIFICATION_PERMISSION_REQUEST(request));
+
+ WebKitNotificationPermissionRequestPrivate* priv = WEBKIT_NOTIFICATION_PERMISSION_REQUEST(request)->priv;
+
+ // Only one decision at a time.
+ if (priv->madeDecision)
+ return;
+
+ priv->request->allow();
+ priv->madeDecision = true;
+}
+
+static void webkitNotificationPermissionRequestDeny(WebKitPermissionRequest* request)
+{
+ ASSERT(WEBKIT_IS_NOTIFICATION_PERMISSION_REQUEST(request));
+
+ WebKitNotificationPermissionRequestPrivate* priv = WEBKIT_NOTIFICATION_PERMISSION_REQUEST(request)->priv;
+
+ // Only one decision at a time.
+ if (priv->madeDecision)
+ return;
+
+ priv->request->deny();
+ priv->madeDecision = true;
+}
+
+static void webkit_permission_request_interface_init(WebKitPermissionRequestIface* iface)
+{
+ iface->allow = webkitNotificationPermissionRequestAllow;
+ iface->deny = webkitNotificationPermissionRequestDeny;
+}
+
+static void webkitNotificationPermissionRequestDispose(GObject* object)
+{
+ // Default behaviour when no decision has been made is denying the request.
+ webkitNotificationPermissionRequestDeny(WEBKIT_PERMISSION_REQUEST(object));
+ G_OBJECT_CLASS(webkit_notification_permission_request_parent_class)->dispose(object);
+}
+
+static void webkit_notification_permission_request_class_init(WebKitNotificationPermissionRequestClass* klass)
+{
+ GObjectClass* objectClass = G_OBJECT_CLASS(klass);
+ objectClass->dispose = webkitNotificationPermissionRequestDispose;
+}
+
+WebKitNotificationPermissionRequest* webkitNotificationPermissionRequestCreate(NotificationPermissionRequest* request)
+{
+ WebKitNotificationPermissionRequest* notificationPermissionRequest = WEBKIT_NOTIFICATION_PERMISSION_REQUEST(g_object_new(WEBKIT_TYPE_NOTIFICATION_PERMISSION_REQUEST, nullptr));
+ notificationPermissionRequest->priv->request = request;
+ return notificationPermissionRequest;
+}
</ins></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIgtkWebKitNotificationPermissionRequesth"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit2/UIProcess/API/gtk/WebKitNotificationPermissionRequest.h (0 => 177073)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/gtk/WebKitNotificationPermissionRequest.h         (rev 0)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/WebKitNotificationPermissionRequest.h        2014-12-10 17:36:40 UTC (rev 177073)
</span><span class="lines">@@ -0,0 +1,59 @@
</span><ins>+/*
+ * Copyright (C) 2013 Igalia S.L.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#if !defined(__WEBKIT2_H_INSIDE__) && !defined(WEBKIT2_COMPILATION)
+#error "Only <webkit2/webkit2.h> can be included directly."
+#endif
+
+#ifndef WebKitNotificationPermissionRequest_h
+#define WebKitNotificationPermissionRequest_h
+
+#include <glib-object.h>
+#include <webkit2/WebKitDefines.h>
+
+G_BEGIN_DECLS
+
+#define WEBKIT_TYPE_NOTIFICATION_PERMISSION_REQUEST (webkit_notification_permission_request_get_type())
+#define WEBKIT_NOTIFICATION_PERMISSION_REQUEST(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), WEBKIT_TYPE_NOTIFICATION_PERMISSION_REQUEST, WebKitNotificationPermissionRequest))
+#define WEBKIT_NOTIFICATION_PERMISSION_REQUEST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), WEBKIT_TYPE_NOTIFICATION_PERMISSION_REQUEST, WebKitNotificationPermissionRequestClass))
+#define WEBKIT_IS_NOTIFICATION_PERMISSION_REQUEST(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), WEBKIT_TYPE_NOTIFICATION_PERMISSION_REQUEST))
+#define WEBKIT_IS_NOTIFICATION_PERMISSION_REQUEST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), WEBKIT_TYPE_NOTIFICATION_PERMISSION_REQUEST))
+#define WEBKIT_NOTIFICATION_PERMISSION_REQUEST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), WEBKIT_TYPE_NOTIFICATION_PERMISSION_REQUEST, WebKitNotificationPermissionRequestClass))
+
+typedef struct _WebKitNotificationPermissionRequest WebKitNotificationPermissionRequest;
+typedef struct _WebKitNotificationPermissionRequestClass WebKitNotificationPermissionRequestClass;
+typedef struct _WebKitNotificationPermissionRequestPrivate WebKitNotificationPermissionRequestPrivate;
+
+struct _WebKitNotificationPermissionRequest {
+ GObject parent;
+
+ /*< private >*/
+ WebKitNotificationPermissionRequestPrivate *priv;
+};
+
+struct _WebKitNotificationPermissionRequestClass {
+ GObjectClass parent_class;
+};
+
+WEBKIT_API GType
+webkit_notification_permission_request_get_type (void);
+
+G_END_DECLS
+
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIgtkWebKitNotificationPermissionRequestPrivateh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit2/UIProcess/API/gtk/WebKitNotificationPermissionRequestPrivate.h (0 => 177073)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/gtk/WebKitNotificationPermissionRequestPrivate.h         (rev 0)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/WebKitNotificationPermissionRequestPrivate.h        2014-12-10 17:36:40 UTC (rev 177073)
</span><span class="lines">@@ -0,0 +1,28 @@
</span><ins>+/*
+ * Copyright (C) 2013 Igalia S.L.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef WebKitNotificationPermissionRequestPrivate_h
+#define WebKitNotificationPermissionRequestPrivate_h
+
+#include "WebKitNotificationPermissionRequest.h"
+#include "WebKitPrivate.h"
+
+WebKitNotificationPermissionRequest* webkitNotificationPermissionRequestCreate(WebKit::NotificationPermissionRequest*);
+
+#endif // WebKitNotificationPermissionRequestPrivate_h
</ins></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIgtkWebKitNotificationPrivateh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit2/UIProcess/API/gtk/WebKitNotificationPrivate.h (0 => 177073)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/gtk/WebKitNotificationPrivate.h         (rev 0)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/WebKitNotificationPrivate.h        2014-12-10 17:36:40 UTC (rev 177073)
</span><span class="lines">@@ -0,0 +1,31 @@
</span><ins>+/*
+ * Copyright (C) 2014 Collabora Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef WebKitNotificationPrivate_h
+#define WebKitNotificationPrivate_h
+
+#include "WebKitNotification.h"
+#include "WebKitPrivate.h"
+#include "WebNotification.h"
+#include <wtf/text/CString.h>
+
+WebKitNotification* webkitNotificationCreate(WebKitWebView*, const WebKit::WebNotification&);
+WebKitWebView* webkitNotificationGetWebView(WebKitNotification*);
+
+#endif // WebKitNotificationPrivate_h
</ins></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIgtkWebKitNotificationProvidercpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit2/UIProcess/API/gtk/WebKitNotificationProvider.cpp (0 => 177073)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/gtk/WebKitNotificationProvider.cpp         (rev 0)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/WebKitNotificationProvider.cpp        2014-12-10 17:36:40 UTC (rev 177073)
</span><span class="lines">@@ -0,0 +1,119 @@
</span><ins>+/*
+ * Copyright (C) 2013 Igalia S.L.
+ * Copyright (C) 2014 Collabora Ltd.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "WebKitNotificationProvider.h"
+
+#include "APIArray.h"
+#include "WKNotificationManager.h"
+#include "WebKitNotificationPrivate.h"
+#include "WebKitWebViewPrivate.h"
+#include "WebNotificationManagerProxy.h"
+#include "WebPageProxy.h"
+#include <wtf/text/CString.h>
+
+using namespace WebKit;
+
+static inline WebKitNotificationProvider* toNotificationProvider(const void* clientInfo)
+{
+ return static_cast<WebKitNotificationProvider*>(const_cast<void*>(clientInfo));
+}
+
+static void showCallback(WKPageRef page, WKNotificationRef notification, const void* clientInfo)
+{
+ toNotificationProvider(clientInfo)->show(toImpl(page), *toImpl(notification));
+}
+
+static void cancelCallback(WKNotificationRef notification, const void* clientInfo)
+{
+ toNotificationProvider(clientInfo)->cancel(*toImpl(notification));
+}
+
+static void clearNotificationsCallback(WKArrayRef notificationIDs, const void* clientInfo)
+{
+ toNotificationProvider(clientInfo)->clearNotifications(toImpl(notificationIDs));
+}
+
+WebKitNotificationProvider::~WebKitNotificationProvider()
+{
+}
+
+PassRefPtr<WebKitNotificationProvider> WebKitNotificationProvider::create(WebNotificationManagerProxy* notificationManager)
+{
+ return adoptRef(new WebKitNotificationProvider(notificationManager));
+}
+
+WebKitNotificationProvider::WebKitNotificationProvider(WebNotificationManagerProxy* notificationManager)
+ : m_notificationManager(notificationManager)
+{
+ ASSERT(notificationManager);
+
+ WKNotificationProviderV0 wkNotificationProvider = {
+ kWKNotificationProviderCurrentVersion,
+ this, // clientInfo,
+ showCallback,
+ cancelCallback,
+ 0, // didDestroyNotificationCallback,
+ 0, // addNotificationManagerCallback,
+ 0, // removeNotificationManagerCallback,
+ 0, // notificationPermissionsCallback,
+ clearNotificationsCallback,
+ };
+
+ WKNotificationManagerSetProvider(toAPI(notificationManager), reinterpret_cast<WKNotificationProviderBase*>(&wkNotificationProvider));
+}
+
+void WebKitNotificationProvider::show(WebPageProxy* page, const WebNotification& webNotification)
+{
+ GRefPtr<WebKitNotification> notification = m_notifications.get(webNotification.notificationID());
+
+ if (!notification) {
+ notification = adoptGRef(webkitNotificationCreate(WEBKIT_WEB_VIEW(page->viewWidget()), webNotification));
+ m_notifications.set(webNotification.notificationID(), notification);
+ }
+
+ if (webkitWebViewEmitShowNotification(WEBKIT_WEB_VIEW(page->viewWidget()), notification.get()))
+ m_notificationManager->providerDidShowNotification(webNotification.notificationID());
+}
+
+void WebKitNotificationProvider::cancelNotificationByID(uint64_t notificationID)
+{
+ if (GRefPtr<WebKitNotification> notification = m_notifications.get(notificationID))
+ webkitWebViewEmitCloseNotification(webkitNotificationGetWebView(notification.get()), notification.get());
+
+ m_notifications.remove(notificationID);
+}
+
+void WebKitNotificationProvider::cancel(const WebNotification& webNotification)
+{
+ cancelNotificationByID(webNotification.notificationID());
+}
+
+void WebKitNotificationProvider::clearNotifications(const API::Array* notificationIDs)
+{
+ for (const auto& item : notificationIDs->elementsOfType<API::UInt64>())
+ cancelNotificationByID(item->value());
+}
</ins></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIgtkWebKitNotificationProviderh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit2/UIProcess/API/gtk/WebKitNotificationProvider.h (0 => 177073)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/gtk/WebKitNotificationProvider.h         (rev 0)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/WebKitNotificationProvider.h        2014-12-10 17:36:40 UTC (rev 177073)
</span><span class="lines">@@ -0,0 +1,55 @@
</span><ins>+/*
+ * Copyright (C) 2013 Igalia S.L.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef WebKitNotificationProvider_h
+#define WebKitNotificationProvider_h
+
+#include "WebKitPrivate.h"
+#include "WebKitNotification.h"
+#include <wtf/HashMap.h>
+#include <wtf/PassRefPtr.h>
+#include <wtf/RefCounted.h>
+
+namespace API {
+class Array;
+};
+
+namespace WebKit {
+
+class WebKitNotificationProvider : public RefCounted<WebKitNotificationProvider> {
+public:
+ virtual ~WebKitNotificationProvider();
+ static PassRefPtr<WebKitNotificationProvider> create(WebNotificationManagerProxy*);
+
+ void show(WebPageProxy*, const WebNotification&);
+ void cancel(const WebNotification&);
+ void clearNotifications(const API::Array*);
+
+private:
+ WebKitNotificationProvider(WebNotificationManagerProxy*);
+
+ void cancelNotificationByID(uint64_t);
+
+ RefPtr<WebNotificationManagerProxy> m_notificationManager;
+ HashMap<uint64_t, GRefPtr<WebKitNotification>> m_notifications;
+};
+
+} // namespace WebKit
+
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIgtkWebKitUIClientcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/gtk/WebKitUIClient.cpp (177072 => 177073)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/gtk/WebKitUIClient.cpp        2014-12-10 17:12:28 UTC (rev 177072)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/WebKitUIClient.cpp        2014-12-10 17:36:40 UTC (rev 177073)
</span><span class="lines">@@ -24,6 +24,7 @@
</span><span class="cx"> #include "WebKitFileChooserRequestPrivate.h"
</span><span class="cx"> #include "WebKitGeolocationPermissionRequestPrivate.h"
</span><span class="cx"> #include "WebKitNavigationActionPrivate.h"
</span><ins>+#include "WebKitNotificationPermissionRequestPrivate.h"
</ins><span class="cx"> #include "WebKitPrivate.h"
</span><span class="cx"> #include "WebKitURIRequestPrivate.h"
</span><span class="cx"> #include "WebKitUserMediaPermissionRequestPrivate.h"
</span><span class="lines">@@ -166,6 +167,13 @@
</span><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+ virtual bool decidePolicyForNotificationPermissionRequest(WebPageProxy*, WebSecurityOrigin*, NotificationPermissionRequest* permissionRequest) override
+ {
+ GRefPtr<WebKitNotificationPermissionRequest> notificationPermissionRequest = adoptGRef(webkitNotificationPermissionRequestCreate(permissionRequest));
+ webkitWebViewMakePermissionRequest(m_webView, WEBKIT_PERMISSION_REQUEST(notificationPermissionRequest.get()));
+ return true;
+ }
+
</ins><span class="cx"> virtual void printFrame(WebPageProxy*, WebFrameProxy* frame) override
</span><span class="cx"> {
</span><span class="cx"> webkitWebViewPrintFrame(m_webView, frame);
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIgtkWebKitWebContextcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.cpp (177072 => 177073)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.cpp        2014-12-10 17:12:28 UTC (rev 177072)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.cpp        2014-12-10 17:36:40 UTC (rev 177073)
</span><span class="lines">@@ -33,6 +33,7 @@
</span><span class="cx"> #include "WebKitFaviconDatabasePrivate.h"
</span><span class="cx"> #include "WebKitGeolocationProvider.h"
</span><span class="cx"> #include "WebKitInjectedBundleClient.h"
</span><ins>+#include "WebKitNotificationProvider.h"
</ins><span class="cx"> #include "WebKitPluginPrivate.h"
</span><span class="cx"> #include "WebKitPrivate.h"
</span><span class="cx"> #include "WebKitRequestManagerClient.h"
</span><span class="lines">@@ -44,6 +45,7 @@
</span><span class="cx"> #include "WebKitWebContextPrivate.h"
</span><span class="cx"> #include "WebKitWebViewBasePrivate.h"
</span><span class="cx"> #include "WebKitWebViewPrivate.h"
</span><ins>+#include "WebNotificationManagerProxy.h"
</ins><span class="cx"> #include "WebResourceCacheManagerProxy.h"
</span><span class="cx"> #include <WebCore/FileSystem.h>
</span><span class="cx"> #include <WebCore/IconDatabase.h>
</span><span class="lines">@@ -166,6 +168,9 @@
</span><span class="cx"> #if ENABLE(BATTERY_STATUS)
</span><span class="cx"> RefPtr<WebKitBatteryProvider> batteryProvider;
</span><span class="cx"> #endif
</span><ins>+#if ENABLE(NOTIFICATIONS)
+ RefPtr<WebKitNotificationProvider> notificationProvider;
+#endif
</ins><span class="cx"> #if ENABLE(SPELLCHECK)
</span><span class="cx"> std::unique_ptr<WebKitTextChecker> textChecker;
</span><span class="cx"> #endif
</span><span class="lines">@@ -278,6 +283,9 @@
</span><span class="cx"> #if ENABLE(BATTERY_STATUS)
</span><span class="cx"> priv->batteryProvider = WebKitBatteryProvider::create(priv->context->supplement<WebBatteryManagerProxy>());
</span><span class="cx"> #endif
</span><ins>+#if ENABLE(NOTIFICATIONS)
+ priv->notificationProvider = WebKitNotificationProvider::create(priv->context->supplement<WebNotificationManagerProxy>());
+#endif
</ins><span class="cx"> #if ENABLE(SPELLCHECK)
</span><span class="cx"> priv->textChecker = WebKitTextChecker::create();
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIgtkWebKitWebViewcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp (177072 => 177073)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp        2014-12-10 17:12:28 UTC (rev 177072)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp        2014-12-10 17:36:40 UTC (rev 177073)
</span><span class="lines">@@ -1,6 +1,7 @@
</span><span class="cx"> /*
</span><span class="cx"> * Copyright (C) 2011 Igalia S.L.
</span><span class="cx"> * Portions Copyright (c) 2011 Motorola Mobility, Inc. All rights reserved.
</span><ins>+ * Copyright (C) 2014 Collabora Ltd.
</ins><span class="cx"> *
</span><span class="cx"> * This library is free software; you can redistribute it and/or
</span><span class="cx"> * modify it under the terms of the GNU Library General Public
</span><span class="lines">@@ -42,6 +43,7 @@
</span><span class="cx"> #include "WebKitJavascriptResultPrivate.h"
</span><span class="cx"> #include "WebKitLoaderClient.h"
</span><span class="cx"> #include "WebKitMarshal.h"
</span><ins>+#include "WebKitNotificationPrivate.h"
</ins><span class="cx"> #include "WebKitPolicyClient.h"
</span><span class="cx"> #include "WebKitPrintOperationPrivate.h"
</span><span class="cx"> #include "WebKitPrivate.h"
</span><span class="lines">@@ -69,6 +71,10 @@
</span><span class="cx"> #include <wtf/gobject/GRefPtr.h>
</span><span class="cx"> #include <wtf/text/CString.h>
</span><span class="cx">
</span><ins>+#if USE(LIBNOTIFY)
+#include <libnotify/notify.h>
+#endif
+
</ins><span class="cx"> using namespace WebKit;
</span><span class="cx"> using namespace WebCore;
</span><span class="cx">
</span><span class="lines">@@ -124,6 +130,9 @@
</span><span class="cx">
</span><span class="cx"> AUTHENTICATE,
</span><span class="cx">
</span><ins>+ SHOW_NOTIFICATION,
+ CLOSE_NOTIFICATION,
+
</ins><span class="cx"> LAST_SIGNAL
</span><span class="cx"> };
</span><span class="cx">
</span><span class="lines">@@ -144,6 +153,9 @@
</span><span class="cx">
</span><span class="cx"> typedef HashMap<uint64_t, GRefPtr<WebKitWebResource> > LoadingResourcesMap;
</span><span class="cx"> typedef HashMap<uint64_t, GRefPtr<GTask> > SnapshotResultsMap;
</span><ins>+#if USE(LIBNOTIFY)
+typedef HashMap<uint64_t, GRefPtr<NotifyNotification>> NotifyNotificationsMap;
+#endif
</ins><span class="cx"> class PageLoadStateObserver;
</span><span class="cx">
</span><span class="cx"> struct _WebKitWebViewPrivate {
</span><span class="lines">@@ -194,6 +206,10 @@
</span><span class="cx">
</span><span class="cx"> SnapshotResultsMap snapshotResultsMap;
</span><span class="cx"> GRefPtr<WebKitAuthenticationRequest> authenticationRequest;
</span><ins>+
+#if USE(LIBNOTIFY)
+ NotifyNotificationsMap notifyNotificationsMap;
+#endif
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> static guint signals[LAST_SIGNAL] = { 0, };
</span><span class="lines">@@ -562,6 +578,44 @@
</span><span class="cx"> webkitDownloadSetWebView(download.get(), WEBKIT_WEB_VIEW(webViewBase));
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+static gboolean webkitWebViewShowNotification(WebKitWebView* webView, WebKitNotification* webNotification)
+{
+#if USE(LIBNOTIFY)
+ if (!notify_is_initted())
+ notify_init(g_get_prgname());
+
+ GRefPtr<NotifyNotification> notification = webView->priv->notifyNotificationsMap.get(webkit_notification_get_id(webNotification));
+ if (!notification) {
+ notification = adoptGRef(notify_notification_new(webkit_notification_get_title(webNotification),
+ webkit_notification_get_body(webNotification), nullptr));
+
+ webView->priv->notifyNotificationsMap.set(webkit_notification_get_id(webNotification), notification);
+ } else
+ notify_notification_update(notification.get(), webkit_notification_get_title(webNotification),
+ webkit_notification_get_body(webNotification), nullptr);
+
+ notify_notification_show(notification.get(), nullptr);
+ return TRUE;
+#else
+ UNUSED_PARAM(webNotification);
+ return FALSE;
+#endif
+}
+
+static gboolean webkitWebViewCloseNotification(WebKitWebView* webView, WebKitNotification* webNotification)
+{
+#if USE(LIBNOTIFY)
+ if (GRefPtr<NotifyNotification> notification = webView->priv->notifyNotificationsMap.get(webkit_notification_get_id(webNotification))) {
+ notify_notification_close(notification.get(), nullptr);
+ webView->priv->notifyNotificationsMap.remove(webkit_notification_get_id(webNotification));
+ }
+ return TRUE;
+#else
+ UNUSED_PARAM(webNotification);
+ return FALSE;
+#endif
+}
+
</ins><span class="cx"> static void webkitWebViewConstructed(GObject* object)
</span><span class="cx"> {
</span><span class="cx"> G_OBJECT_CLASS(webkit_web_view_parent_class)->constructed(object);
</span><span class="lines">@@ -713,6 +767,8 @@
</span><span class="cx"> webViewClass->permission_request = webkitWebViewPermissionRequest;
</span><span class="cx"> webViewClass->run_file_chooser = webkitWebViewRunFileChooser;
</span><span class="cx"> webViewClass->authenticate = webkitWebViewAuthenticate;
</span><ins>+ webViewClass->show_notification = webkitWebViewShowNotification;
+ webViewClass->close_notification = webkitWebViewCloseNotification;
</ins><span class="cx">
</span><span class="cx"> /**
</span><span class="cx"> * WebKitWebView:web-context:
</span><span class="lines">@@ -1574,6 +1630,56 @@
</span><span class="cx"> webkit_marshal_BOOLEAN__OBJECT,
</span><span class="cx"> G_TYPE_BOOLEAN, 1, /* number of parameters */
</span><span class="cx"> WEBKIT_TYPE_AUTHENTICATION_REQUEST);
</span><ins>+
+ /**
+ * WebKitWebView::show-notification:
+ * @web_view: the #WebKitWebView
+ * @notification: a #WebKitNofication
+ *
+ * This signal is emitted when a notification should be presented to the
+ * user. The @notification is kept alive until either: 1) the web page cancels it
+ * or 2) a navigation happens.
+ *
+ * The default handler will emit a notification using libnotify, if built with
+ * support for it.
+ *
+ * Returns: %TRUE to stop other handlers from being invoked. %FALSE otherwise.
+ *
+ * Since: 2.8
+ */
+ signals[SHOW_NOTIFICATION] =
+ g_signal_new("show-notification",
+ G_TYPE_FROM_CLASS(gObjectClass),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET(WebKitWebViewClass, show_notification),
+ g_signal_accumulator_true_handled, nullptr /* accumulator data */,
+ webkit_marshal_BOOLEAN__OBJECT,
+ G_TYPE_BOOLEAN, 1,
+ WEBKIT_TYPE_NOTIFICATION);
+
+ /**
+ * WebKitNotification::close-notification:
+ * @web_view: the #WebKitWebView
+ * @notification: a #WebKitNofication
+ *
+ * This signal is emitted when a notification should be withdrawn.
+ *
+ * The default handler will close the notification using libnotify, if built with
+ * support for it.
+ *
+ * Returns: %TRUE to stop other handlers from being invoked. %FALSE otherwise.
+ *
+ * Since: 2.8
+ */
+ signals[CLOSE_NOTIFICATION] =
+ g_signal_new("close-notification",
+ G_TYPE_FROM_CLASS(gObjectClass),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET(WebKitWebViewClass, close_notification),
+ g_signal_accumulator_true_handled, nullptr /* accumulator data */,
+ webkit_marshal_BOOLEAN__OBJECT,
+ G_TYPE_BOOLEAN, 1,
+ WEBKIT_TYPE_NOTIFICATION);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> static void webkitWebViewCancelAuthenticationRequest(WebKitWebView* webView)
</span><span class="lines">@@ -1957,6 +2063,19 @@
</span><span class="cx"> g_signal_emit(webView, signals[INSECURE_CONTENT_DETECTED], 0, type);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+bool webkitWebViewEmitShowNotification(WebKitWebView* webView, WebKitNotification* webNotification)
+{
+ gboolean handled;
+ g_signal_emit(webView, signals[SHOW_NOTIFICATION], 0, webNotification, &handled);
+ return handled;
+}
+
+void webkitWebViewEmitCloseNotification(WebKitWebView* webView, WebKitNotification* webNotification)
+{
+ gboolean handled;
+ g_signal_emit(webView, signals[CLOSE_NOTIFICATION], 0, webNotification, &handled);
+}
+
</ins><span class="cx"> /**
</span><span class="cx"> * webkit_web_view_new:
</span><span class="cx"> *
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIgtkWebKitWebViewh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebView.h (177072 => 177073)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebView.h        2014-12-10 17:12:28 UTC (rev 177072)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebView.h        2014-12-10 17:36:40 UTC (rev 177073)
</span><span class="lines">@@ -238,12 +238,15 @@
</span><span class="cx"> const gchar *failing_uri,
</span><span class="cx"> GTlsCertificate *certificate,
</span><span class="cx"> GTlsCertificateFlags errors);
</span><ins>+ gboolean (* show_notification) (WebKitWebView *web_view,
+ WebKitNotification *notification);
+ gboolean (* close_notification) (WebKitWebView *web_view,
+ WebKitNotification *notification);
+
</ins><span class="cx"> void (*_webkit_reserved0) (void);
</span><span class="cx"> void (*_webkit_reserved1) (void);
</span><span class="cx"> void (*_webkit_reserved2) (void);
</span><span class="cx"> void (*_webkit_reserved3) (void);
</span><del>- void (*_webkit_reserved4) (void);
- void (*_webkit_reserved5) (void);
</del><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> WEBKIT_API GType
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIgtkWebKitWebViewPrivateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewPrivate.h (177072 => 177073)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewPrivate.h        2014-12-10 17:12:28 UTC (rev 177072)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewPrivate.h        2014-12-10 17:36:40 UTC (rev 177073)
</span><span class="lines">@@ -57,6 +57,8 @@
</span><span class="cx"> void webkitWebViewSubmitFormRequest(WebKitWebView*, WebKitFormSubmissionRequest*);
</span><span class="cx"> void webkitWebViewHandleAuthenticationChallenge(WebKitWebView*, WebKit::AuthenticationChallengeProxy*);
</span><span class="cx"> void webkitWebViewInsecureContentDetected(WebKitWebView*, WebKitInsecureContentEvent);
</span><ins>+bool webkitWebViewEmitShowNotification(WebKitWebView*, WebKitNotification*);
+void webkitWebViewEmitCloseNotification(WebKitWebView*, WebKitNotification*);
</ins><span class="cx"> void webkitWebViewWebProcessCrashed(WebKitWebView*);
</span><span class="cx">
</span><span class="cx"> #endif // WebKitWebViewPrivate_h
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIgtkdocswebkit2gtksectionstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-sections.txt (177072 => 177073)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-sections.txt        2014-12-10 17:12:28 UTC (rev 177072)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-sections.txt        2014-12-10 17:36:40 UTC (rev 177073)
</span><span class="lines">@@ -616,6 +616,45 @@
</span><span class="cx"> </SECTION>
</span><span class="cx">
</span><span class="cx"> <SECTION>
</span><ins>+<FILE>WebKitNotification</FILE>
+WebKitNotification
+webkit_notification_get_id
+webkit_notification_get_title
+webkit_notification_get_body
+
+<SUBSECTION Standard>
+WebKitNotificationClass
+WEBKIT_TYPE_NOTIFICATION
+WEBKIT_IS_NOTIFICATION
+WEBKIT_NOTIFICATION
+WEBKIT_NOTIFICATION_CLASS
+WEBKIT_IS_NOTIFICATION_CLASS
+WEBKIT_NOTIFICATION_GET_CLASS
+
+<SUBSECTION Private>
+WebKitNotificationPrivate
+webkit_notification_get_type
+</SECTION>
+
+<SECTION>
+<FILE>WebKitNotificationPermissionRequest</FILE>
+WebKitNotificationPermissionRequest
+
+<SUBSECTION Standard>
+WebKitNotificationPermissionRequestClass
+WEBKIT_TYPE_NOTIFICATION_PERMISSION_REQUEST
+WEBKIT_NOTIFICATION_PERMISSION_REQUEST
+WEBKIT_IS_NOTIFICATION_PERMISSION_REQUEST
+WEBKIT_NOTIFICATION_PERMISSION_REQUEST_CLASS
+WEBKIT_IS_NOTIFICATION_PERMISSION_REQUEST_CLASS
+WEBKIT_NOTIFICATION_PERMISSION_REQUEST_GET_CLASS
+
+<SUBSECTION Private>
+WebKitNotificationPermissionRequestPrivate
+webkit_notification_permission_request_get_type
+</SECTION>
+
+<SECTION>
</ins><span class="cx"> <FILE>WebKitPolicyDecision</FILE>
</span><span class="cx"> WebKitPolicyDecision
</span><span class="cx"> webkit_policy_decision_download
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIgtkwebkit2h"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/gtk/webkit2.h (177072 => 177073)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/gtk/webkit2.h        2014-12-10 17:12:28 UTC (rev 177072)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/webkit2.h        2014-12-10 17:36:40 UTC (rev 177073)
</span><span class="lines">@@ -50,6 +50,8 @@
</span><span class="cx"> #include <webkit2/WebKitMimeInfo.h>
</span><span class="cx"> #include <webkit2/WebKitNavigationAction.h>
</span><span class="cx"> #include <webkit2/WebKitNavigationPolicyDecision.h>
</span><ins>+#include <webkit2/WebKitNotification.h>
+#include <webkit2/WebKitNotificationPermissionRequest.h>
</ins><span class="cx"> #include <webkit2/WebKitPermissionRequest.h>
</span><span class="cx"> #include <webkit2/WebKitPlugin.h>
</span><span class="cx"> #include <webkit2/WebKitPrintOperation.h>
</span></span></pre></div>
<a id="trunkSourcecmakeFindLibNotifycmake"></a>
<div class="addfile"><h4>Added: trunk/Source/cmake/FindLibNotify.cmake (0 => 177073)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/cmake/FindLibNotify.cmake         (rev 0)
+++ trunk/Source/cmake/FindLibNotify.cmake        2014-12-10 17:36:40 UTC (rev 177073)
</span><span class="lines">@@ -0,0 +1,55 @@
</span><ins>+# - Try to find LibNotify
+# This module defines the following variables:
+#
+# LIBNOTIFY_FOUND - LibNotify was found
+# LIBNOTIFY_INCLUDE_DIRS - the LibNotify include directories
+# LIBNOTIFY_LIBRARIES - link these to use LibNotify
+#
+# Copyright (C) 2012 Raphael Kubo da Costa <rakuco@webkit.org>
+# Copyright (C) 2014 Collabora Ltd.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND ITS CONTRIBUTORS ``AS
+# IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR ITS
+# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+find_package(PkgConfig)
+pkg_check_modules(LIBNOTIFY QUIET libnotify)
+
+find_path(LIBNOTIFY_INCLUDE_DIRS
+ NAMES notify.h
+ HINTS ${LIBNOTIFY_INCLUDEDIR}
+ ${LIBNOTIFY_INCLUDE_DIRS}
+ PATH_SUFFIXES libnotify
+)
+
+find_library(LIBNOTIFY_LIBRARIES
+ NAMES notify
+ HINTS ${LIBNOTIFY_LIBDIR}
+ ${LIBNOTIFY_LIBRARY_DIRS}
+)
+
+include(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibNotify REQUIRED_VARS LIBNOTIFY_INCLUDE_DIRS LIBNOTIFY_LIBRARIES
+ VERSION_VAR LIBNOTIFY_VERSION)
+
+mark_as_advanced(
+ LIBNOTIFY_INCLUDE_DIRS
+ LIBNOTIFY_LIBRARIES
+)
</ins></span></pre></div>
<a id="trunkSourcecmakeOptionsGTKcmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/cmake/OptionsGTK.cmake (177072 => 177073)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/cmake/OptionsGTK.cmake        2014-12-10 17:12:28 UTC (rev 177072)
+++ trunk/Source/cmake/OptionsGTK.cmake        2014-12-10 17:36:40 UTC (rev 177073)
</span><span class="lines">@@ -50,6 +50,7 @@
</span><span class="cx"> find_package(EGL)
</span><span class="cx"> find_package(GeoClue2 2.1.5)
</span><span class="cx"> find_package(GnuTLS 3.0.0)
</span><ins>+find_package(LibNotify)
</ins><span class="cx">
</span><span class="cx"> if (NOT GEOCLUE2_FOUND)
</span><span class="cx"> find_package(GeoClue)
</span><span class="lines">@@ -151,6 +152,7 @@
</span><span class="cx"> WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_NAVIGATOR_CONTENT_UTILS OFF)
</span><span class="cx"> WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_NAVIGATOR_HWCONCURRENCY ON)
</span><span class="cx"> WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_NETSCAPE_PLUGIN_API ON)
</span><ins>+WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_NOTIFICATIONS ON)
</ins><span class="cx"> WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_PICTURE_SIZES ON)
</span><span class="cx"> WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_QUOTA OFF)
</span><span class="cx"> WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_RESOLUTION_MEDIA_QUERY OFF)
</span><span class="lines">@@ -173,6 +175,12 @@
</span><span class="cx"> WEBKIT_OPTION_DEFAULT_PORT_VALUE(WTF_USE_TILED_BACKING_STORE OFF)
</span><span class="cx"> WEBKIT_OPTION_END()
</span><span class="cx">
</span><ins>+if (LIBNOTIFY_FOUND)
+ add_definitions(-DWTF_USE_LIBNOTIFY=1)
+else ()
+ add_definitions(-DWTF_USE_LIBNOTIFY=0)
+endif ()
+
</ins><span class="cx"> if (ENABLE_PLUGIN_PROCESS_GTK2)
</span><span class="cx"> find_package(GTK2 2.24.10 REQUIRED)
</span><span class="cx"> find_package(GDK2 2.24.10 REQUIRED)
</span></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (177072 => 177073)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog        2014-12-10 17:12:28 UTC (rev 177072)
+++ trunk/Tools/ChangeLog        2014-12-10 17:36:40 UTC (rev 177073)
</span><span class="lines">@@ -1,3 +1,19 @@
</span><ins>+2014-12-09 Gustavo Noronha Silva <gustavo.noronha@collabora.com>
+
+ [GTK][WK2] Add HTML5 Notifications support
+ https://bugs.webkit.org/show_bug.cgi?id=61140
+
+ Reviewed by Carlos Garcia Campos.
+
+ * Scripts/webkitperl/FeatureList.pm: enable notifications for GTK+.
+ * TestWebKitAPI/Tests/WebKit2Gtk/TestWebKitWebView.cpp:
+ (testWebViewNotification):
+ (beforeAll):
+ * MiniBrowser/gtk/BrowserWindow.c: also handle notification permission requests.
+ (permissionRequestDialogCallback):
+ (webViewDecidePermissionRequest):
+ (geolocationRequestDialogCallback): Deleted.
+
</ins><span class="cx"> 2014-12-09 Benjamin Poulain <bpoulain@apple.com>
</span><span class="cx">
</span><span class="cx"> Fix webkitpy test expectation
</span></span></pre></div>
<a id="trunkToolsMiniBrowsergtkBrowserWindowc"></a>
<div class="modfile"><h4>Modified: trunk/Tools/MiniBrowser/gtk/BrowserWindow.c (177072 => 177073)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/MiniBrowser/gtk/BrowserWindow.c        2014-12-10 17:12:28 UTC (rev 177072)
+++ trunk/Tools/MiniBrowser/gtk/BrowserWindow.c        2014-12-10 17:36:40 UTC (rev 177073)
</span><span class="lines">@@ -416,6 +416,10 @@
</span><span class="cx"> dialog_title = "Geolocation request";
</span><span class="cx"> dialog_message_format = "%s";
</span><span class="cx"> dialog_message = "Allow geolocation request?";
</span><ins>+ } else if (WEBKIT_IS_NOTIFICATION_PERMISSION_REQUEST(request)) {
+ dialog_title = "Notification request";
+ dialog_message_format = "%s";
+ dialog_message = "Allow notifications request?";
</ins><span class="cx"> } else if (WEBKIT_IS_USER_MEDIA_PERMISSION_REQUEST(request)) {
</span><span class="cx"> dialog_message_format = "Allow access to %s device?";
</span><span class="cx"> gboolean is_for_audio_device = webkit_user_media_permission_is_for_audio_device(WEBKIT_USER_MEDIA_PERMISSION_REQUEST(request));
</span></span></pre></div>
<a id="trunkToolsScriptswebkitperlFeatureListpm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/Scripts/webkitperl/FeatureList.pm (177072 => 177073)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/Scripts/webkitperl/FeatureList.pm        2014-12-10 17:12:28 UTC (rev 177072)
+++ trunk/Tools/Scripts/webkitperl/FeatureList.pm        2014-12-10 17:36:40 UTC (rev 177073)
</span><span class="lines">@@ -327,7 +327,7 @@
</span><span class="cx"> define => "ENABLE_NOSNIFF", default => isEfl(), value => \$nosniffSupport },
</span><span class="cx">
</span><span class="cx"> { option => "notifications", desc => "Toggle Notifications support",
</span><del>- define => "ENABLE_NOTIFICATIONS", default => 0, value => \$notificationsSupport },
</del><ins>+ define => "ENABLE_NOTIFICATIONS", default => isGtk(), value => \$notificationsSupport },
</ins><span class="cx">
</span><span class="cx"> { option => "orientation-events", desc => "Toggle Orientation Events support",
</span><span class="cx"> define => "ENABLE_ORIENTATION_EVENTS", default => isIOSWebKit(), value => \$orientationEventsSupport },
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsWebKit2GtkTestWebKitWebViewcpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestWebKitWebView.cpp (177072 => 177073)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestWebKitWebView.cpp        2014-12-10 17:12:28 UTC (rev 177072)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestWebKitWebView.cpp        2014-12-10 17:36:40 UTC (rev 177073)
</span><span class="lines">@@ -1,5 +1,6 @@
</span><span class="cx"> /*
</span><span class="cx"> * Copyright (C) 2011 Igalia S.L.
</span><ins>+ * Copyright (C) 2014 Collabora Ltd.
</ins><span class="cx"> *
</span><span class="cx"> * This library is free software; you can redistribute it and/or
</span><span class="cx"> * modify it under the terms of the GNU Lesser General Public
</span><span class="lines">@@ -18,12 +19,15 @@
</span><span class="cx"> */
</span><span class="cx">
</span><span class="cx"> #include "config.h"
</span><ins>+#include "WebKitTestServer.h"
</ins><span class="cx"> #include "WebViewTest.h"
</span><span class="cx"> #include <JavaScriptCore/JSStringRef.h>
</span><span class="cx"> #include <JavaScriptCore/JSValueRef.h>
</span><span class="cx"> #include <glib/gstdio.h>
</span><span class="cx"> #include <wtf/gobject/GRefPtr.h>
</span><span class="cx">
</span><ins>+static WebKitTestServer* gServer;
+
</ins><span class="cx"> static void testWebViewWebContext(WebViewTest* test, gconstpointer)
</span><span class="cx"> {
</span><span class="cx"> g_assert(webkit_web_view_get_context(test->m_webView) == test->m_webContext.get());
</span><span class="lines">@@ -581,8 +585,142 @@
</span><span class="cx"> g_assert(test->getSnapshotAndCancel());
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+class NotificationWebViewTest: public WebViewTest {
+public:
+ MAKE_GLIB_TEST_FIXTURE(NotificationWebViewTest);
+
+ enum NotificationEvent {
+ None,
+ Permission,
+ Shown,
+ Cancelled
+ };
+
+ static gboolean permissionRequestCallback(WebKitWebView*, WebKitPermissionRequest *request, NotificationWebViewTest* test)
+ {
+ g_assert(WEBKIT_IS_NOTIFICATION_PERMISSION_REQUEST(request));
+ test->assertObjectIsDeletedWhenTestFinishes(G_OBJECT(request));
+
+ test->m_event = Permission;
+
+ webkit_permission_request_allow(request);
+
+ g_main_loop_quit(test->m_mainLoop);
+
+ return TRUE;
+ }
+
+ static gboolean showNotificationCallback(WebKitWebView*, WebKitNotification* notification, NotificationWebViewTest* test)
+ {
+ test->assertObjectIsDeletedWhenTestFinishes(G_OBJECT(notification));
+ test->m_notification = notification;
+ test->m_event = Shown;
+ g_main_loop_quit(test->m_mainLoop);
+ return TRUE;
+ }
+
+ static gboolean closeNotificationCallback(WebKitWebView*, WebKitNotification*, NotificationWebViewTest* test)
+ {
+ test->m_notification = nullptr;
+ test->m_event = Cancelled;
+ g_main_loop_quit(test->m_mainLoop);
+ return TRUE;
+ }
+
+ NotificationWebViewTest()
+ : m_event(None)
+ {
+ g_signal_connect(m_webView, "permission-request", G_CALLBACK(permissionRequestCallback), this);
+ g_signal_connect(m_webView, "show-notification", G_CALLBACK(showNotificationCallback), this);
+ g_signal_connect(m_webView, "close-notification", G_CALLBACK(closeNotificationCallback), this);
+
+ }
+
+ ~NotificationWebViewTest()
+ {
+ g_signal_handlers_disconnect_matched(m_webView, G_SIGNAL_MATCH_DATA, 0, 0, 0, 0, this);
+ }
+
+ void requestPermissionAndWaitUntilGiven()
+ {
+ m_event = None;
+ webkit_web_view_run_javascript(m_webView, "Notification.requestPermission();", nullptr, nullptr, nullptr);
+ g_main_loop_run(m_mainLoop);
+ }
+
+ void requestNotificationAndWaitUntilShown(const char* title, const char* body)
+ {
+ m_event = None;
+
+ GUniquePtr<char> jscode(g_strdup_printf("n = new Notification('%s', { body: '%s'});", title, body));
+ webkit_web_view_run_javascript(m_webView, jscode.get(), nullptr, nullptr, nullptr);
+
+ g_main_loop_run(m_mainLoop);
+ }
+
+ void closeNotificationAndWaitUntilCancelled()
+ {
+ m_event = None;
+ webkit_web_view_run_javascript(m_webView, "n.close()", nullptr, nullptr, nullptr);
+ g_main_loop_run(m_mainLoop);
+ }
+
+ NotificationEvent m_event;
+ WebKitNotification* m_notification;
+};
+
+static void testWebViewNotification(NotificationWebViewTest* test, gconstpointer)
+{
+ // Notifications don't work with local or special schemes.
+ test->loadURI(gServer->getURIForPath("/").data());
+ test->waitUntilLoadFinished();
+
+ test->requestPermissionAndWaitUntilGiven();
+
+ g_assert(test->m_event == NotificationWebViewTest::Permission);
+
+ static const char* title = "This is a notification";
+ static const char* body = "This is the body.";
+ test->requestNotificationAndWaitUntilShown(title, body);
+
+ g_assert(test->m_event == NotificationWebViewTest::Shown);
+ g_assert(test->m_notification);
+ g_assert_cmpstr(webkit_notification_get_title(test->m_notification), ==, title);
+ g_assert_cmpstr(webkit_notification_get_body(test->m_notification), ==, body);
+
+ test->closeNotificationAndWaitUntilCancelled();
+
+ g_assert(test->m_event == NotificationWebViewTest::Cancelled);
+
+ test->requestNotificationAndWaitUntilShown(title, body);
+
+ g_assert(test->m_event == NotificationWebViewTest::Shown);
+
+ test->loadURI(gServer->getURIForPath("/").data());
+ test->waitUntilLoadFinished();
+
+ g_assert(test->m_event == NotificationWebViewTest::Cancelled);
+}
+
+static void serverCallback(SoupServer* server, SoupMessage* message, const char* path, GHashTable*, SoupClientContext*, gpointer)
+{
+ if (message->method != SOUP_METHOD_GET) {
+ soup_message_set_status(message, SOUP_STATUS_NOT_IMPLEMENTED);
+ return;
+ }
+
+ if (g_str_equal(path, "/")) {
+ soup_message_set_status(message, SOUP_STATUS_OK);
+ soup_message_body_complete(message->response_body);
+ } else
+ soup_message_set_status(message, SOUP_STATUS_NOT_FOUND);
+}
+
</ins><span class="cx"> void beforeAll()
</span><span class="cx"> {
</span><ins>+ gServer = new WebKitTestServer();
+ gServer->run(serverCallback);
+
</ins><span class="cx"> WebViewTest::add("WebKitWebView", "web-context", testWebViewWebContext);
</span><span class="cx"> WebViewTest::add("WebKitWebView", "custom-charset", testWebViewCustomCharset);
</span><span class="cx"> WebViewTest::add("WebKitWebView", "settings", testWebViewSettings);
</span><span class="lines">@@ -594,6 +732,7 @@
</span><span class="cx"> SaveWebViewTest::add("WebKitWebView", "save", testWebViewSave);
</span><span class="cx"> SnapshotWebViewTest::add("WebKitWebView", "snapshot", testWebViewSnapshot);
</span><span class="cx"> WebViewTest::add("WebKitWebView", "page-visibility", testWebViewPageVisibility);
</span><ins>+ NotificationWebViewTest::add("WebKitWebView", "notification", testWebViewNotification);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void afterAll()
</span></span></pre>
</div>
</div>
</body>
</html>