[WK2] Add permissions support (73960)
authorjonlee@apple.com <jonlee@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 8 Dec 2011 19:06:59 +0000 (19:06 +0000)
committerjonlee@apple.com <jonlee@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 8 Dec 2011 19:06:59 +0000 (19:06 +0000)
https://bugs.webkit.org/show_bug.cgi?id=73960
<rdar://problem/10357008>

Reviewed by Darin Adler.

Source/WebKit2:

* DerivedSources.make: Moved notification files to its own directory. Need to add that path.
* WebKit2.xcodeproj/project.pbxproj: New header and impl files.
* Target.pri: Ditto.
* GNUmakefile.am: Ditto.
* win/WebKit2.vcproj: Ditto.
* win/WebKit2Common.vsprops: Add path to Notifications directory.

Implement permission functions, which go through permission request manager.

* WebProcess/WebCoreSupport/WebNotificationClient.cpp:
(WebKit::WebNotificationClient::requestPermission):
(WebKit::WebNotificationClient::cancelRequestsForPermission):
(WebKit::WebNotificationClient::checkPermission):

New NotificationPermissionRequestManager to make and cancel permission requests, and to retrieve current
policy.

* WebProcess/Notifications/NotificationPermissionRequestManager.cpp: Added.
(WebKit::generateRequestID):
(WebKit::NotificationPermissionRequestManager::create):
(WebKit::NotificationPermissionRequestManager::NotificationPermissionRequestManager):
(WebKit::NotificationPermissionRequestManager::startRequest): Keep track of the provided callback once
policy decision is made.
(WebKit::NotificationPermissionRequestManager::cancelRequest):
(WebKit::NotificationPermissionRequestManager::permissionLevel): Retrieve level through a synchronous
message to the proxy.
(WebKit::NotificationPermissionRequestManager::didReceiveNotificationPermissionDecision): Invoke the callback.
* WebProcess/Notifications/NotificationPermissionRequestManager.h: Added.
(WebKit::isRequestIDValid): Make sure any provided request IDs are valid.

Added new NotificationPermissionRequest class.

* UIProcess/Notifications/NotificationPermissionRequest.cpp: Added.
(WebKit::NotificationPermissionRequest::create):
(WebKit::NotificationPermissionRequest::NotificationPermissionRequest):
(WebKit::NotificationPermissionRequest::allow): Notify manager of decision.
(WebKit::NotificationPermissionRequest::deny): Ditto.
(WebKit::NotificationPermissionRequest::invalidate): Disassociate with manager.
(WebKit::NotificationPermissionRequest::type):
* UIProcess/Notifications/NotificationPermissionRequest.h: Added.

WKAPI support for NotificationPermissionRequest:

* Shared/API/c/WKBase.h:
* Shared/APIObject.h:
* UIProcess/API/C/WKAPICast.h:
* UIProcess/API/C/WKNotificationPermissionRequest.cpp: Added.
(WKNotificationPermissionRequestGetTypeID):
(WKNotificationPermissionRequestAllow):
(WKNotificationPermissionRequestDeny):
* UIProcess/API/C/WKNotificationPermissionRequest.h: Added.

Other additions to WK API:

* UIProcess/API/C/WKNotificationProvider.h: Added new callback for WKNotificationProviders, to return policy
for a given security origin.
* UIProcess/API/C/WKPage.h: Added new callback to WKPageUIClient to ask user to decide on policy.

New NotificationPermissionRequestManagerProxy to create requests.

* UIProcess/Notifications/NotificationPermissionRequestManagerProxy.cpp: Added.
(WebKit::NotificationPermissionRequestManagerProxy::NotificationPermissionRequestManagerProxy):
(WebKit::NotificationPermissionRequestManagerProxy::invalidateRequests):
(WebKit::NotificationPermissionRequestManagerProxy::createRequest):
(WebKit::NotificationPermissionRequestManagerProxy::didReceiveNotificationPermissionDecision):
* UIProcess/Notifications/NotificationPermissionRequestManagerProxy.h: Added.

Added new message to notification manager: NotificationPermissionLevel, to retrieve policy. The current
JS API retrieves the permission synchronously, so the message needs to be sent synchronously also.

* UIProcess/Notifications/WebNotificationManagerProxy.messages.in: Moved from Source/WebKit2/UIProcess/WebNotificationManagerProxy.messages.in.
* UIProcess/Notifications/WebNotificationProvider.cpp: Moved from Source/WebKit2/UIProcess/WebNotificationProvider.cpp.
(WebKit::WebNotificationProvider::policyForNotificationPermissionAtOrigin): Added.
* UIProcess/Notifications/WebNotificationProvider.h: Moved from Source/WebKit2/UIProcess/WebNotificationProvider.h.
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::didReceiveSyncMessage): Boilerplate to forward messages to notification manager.

* UIProcess/Notifications/WebNotificationManagerProxy.cpp: Moved from Source/WebKit2/UIProcess/WebNotificationManagerProxy.cpp.
(WebKit::WebNotificationManagerProxy::create):
(WebKit::WebNotificationManagerProxy::WebNotificationManagerProxy):
(WebKit::WebNotificationManagerProxy::invalidate):
(WebKit::WebNotificationManagerProxy::initializeProvider):
(WebKit::WebNotificationManagerProxy::didReceiveMessage):
(WebKit::WebNotificationManagerProxy::didReceiveSyncMessage):
(WebKit::WebNotificationManagerProxy::show):
(WebKit::WebNotificationManagerProxy::cancel):
(WebKit::WebNotificationManagerProxy::didDestroyNotification):
(WebKit::WebNotificationManagerProxy::notificationPermissionLevel): Retrieve the policy from the provider.
(WebKit::WebNotificationManagerProxy::providerDidShowNotification):
(WebKit::WebNotificationManagerProxy::providerDidClickNotification):
(WebKit::WebNotificationManagerProxy::providerDidCloseNotifications):
* UIProcess/Notifications/WebNotificationManagerProxy.h: Moved from Source/WebKit2/UIProcess/WebNotificationManagerProxy.h.
(WebKit::WebNotificationManagerProxy::clearContext):
(WebKit::WebNotificationManagerProxy::type):

Added NotificationPermissionRequestManagerProxy to WebPageProxy, to allow a request for permission to
go through to the UI client. Added new message to WebPageProxy, RequestNotificationPermission.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::WebPageProxy):
(WebKit::WebPageProxy::close): Invalidate pending requests.
(WebKit::WebPageProxy::processDidCrash): Ditto.
(WebKit::WebPageProxy::requestNotificationPermission): Forward request to UI client.
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:

* UIProcess/WebUIClient.cpp:
(WebKit::WebUIClient::decidePolicyForNotificationPermissionRequest):
* UIProcess/WebUIClient.h:

Added new message DidReceiveNotificationPermissionDecision. The WebPage forwards the message to the
permission request manager.

* WebProcess/WebPage/WebPage.messages.in: Added new message DidReceiveNotificationPermissionDecision
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::notificationPermissionRequestManager): Create manager on request.
(WebKit::WebPage::didReceiveNotificationPermissionDecision):
* WebProcess/WebPage/WebPage.h:

Moving files to Notifications/ subdirectory.

* UIProcess/Notifications/WebNotification.cpp: Moved from Source/WebKit2/UIProcess/WebNotification.cpp.
* UIProcess/Notifications/WebNotification.h: Moved from Source/WebKit2/UIProcess/WebNotification.h.

Tools:

Add null function item to comply with added callback to WKPageUIClient.

* MiniBrowser/mac/BrowserWindowController.m:
(-[BrowserWindowController awakeFromNib]):
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::createOtherPage):
(WTR::TestController::initialize):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@102352 268f45cc-cd09-0410-ab3c-d52691b4dbfc

41 files changed:
Source/WebKit2/ChangeLog
Source/WebKit2/DerivedSources.make
Source/WebKit2/GNUmakefile.am
Source/WebKit2/Shared/API/c/WKBase.h
Source/WebKit2/Shared/APIObject.h
Source/WebKit2/Target.pri
Source/WebKit2/UIProcess/API/C/WKAPICast.h
Source/WebKit2/UIProcess/API/C/WKNotificationPermissionRequest.cpp [new file with mode: 0644]
Source/WebKit2/UIProcess/API/C/WKNotificationPermissionRequest.h [new file with mode: 0644]
Source/WebKit2/UIProcess/API/C/WKNotificationProvider.h
Source/WebKit2/UIProcess/API/C/WKPage.h
Source/WebKit2/UIProcess/Notifications/NotificationPermissionRequest.cpp [new file with mode: 0644]
Source/WebKit2/UIProcess/Notifications/NotificationPermissionRequest.h [new file with mode: 0644]
Source/WebKit2/UIProcess/Notifications/NotificationPermissionRequestManagerProxy.cpp [new file with mode: 0644]
Source/WebKit2/UIProcess/Notifications/NotificationPermissionRequestManagerProxy.h [new file with mode: 0644]
Source/WebKit2/UIProcess/Notifications/WebNotification.cpp [moved from Source/WebKit2/UIProcess/WebNotification.cpp with 96% similarity]
Source/WebKit2/UIProcess/Notifications/WebNotification.h [moved from Source/WebKit2/UIProcess/WebNotification.h with 98% similarity]
Source/WebKit2/UIProcess/Notifications/WebNotificationManagerProxy.cpp [moved from Source/WebKit2/UIProcess/WebNotificationManagerProxy.cpp with 88% similarity]
Source/WebKit2/UIProcess/Notifications/WebNotificationManagerProxy.h [moved from Source/WebKit2/UIProcess/WebNotificationManagerProxy.h with 87% similarity]
Source/WebKit2/UIProcess/Notifications/WebNotificationManagerProxy.messages.in [moved from Source/WebKit2/UIProcess/WebNotificationManagerProxy.messages.in with 94% similarity]
Source/WebKit2/UIProcess/Notifications/WebNotificationProvider.cpp [moved from Source/WebKit2/UIProcess/WebNotificationProvider.cpp with 89% similarity]
Source/WebKit2/UIProcess/Notifications/WebNotificationProvider.h [moved from Source/WebKit2/UIProcess/WebNotificationProvider.h with 95% similarity]
Source/WebKit2/UIProcess/WebPageProxy.cpp
Source/WebKit2/UIProcess/WebPageProxy.h
Source/WebKit2/UIProcess/WebPageProxy.messages.in
Source/WebKit2/UIProcess/WebProcessProxy.cpp
Source/WebKit2/UIProcess/WebUIClient.cpp
Source/WebKit2/UIProcess/WebUIClient.h
Source/WebKit2/WebKit2.xcodeproj/project.pbxproj
Source/WebKit2/WebProcess/Notifications/NotificationPermissionRequestManager.cpp [new file with mode: 0644]
Source/WebKit2/WebProcess/Notifications/NotificationPermissionRequestManager.h [new file with mode: 0644]
Source/WebKit2/WebProcess/Notifications/WebNotificationManager.h
Source/WebKit2/WebProcess/WebCoreSupport/WebNotificationClient.cpp
Source/WebKit2/WebProcess/WebPage/WebPage.cpp
Source/WebKit2/WebProcess/WebPage/WebPage.h
Source/WebKit2/WebProcess/WebPage/WebPage.messages.in
Source/WebKit2/win/WebKit2.vcproj
Source/WebKit2/win/WebKit2Common.vsprops
Tools/ChangeLog
Tools/MiniBrowser/mac/BrowserWindowController.m
Tools/WebKitTestRunner/TestController.cpp

index e7fc7c2..6989c49 100644 (file)
@@ -1,3 +1,135 @@
+2011-12-06  Jon Lee  <jonlee@apple.com>
+
+        [WK2] Add permissions support (73960)
+        https://bugs.webkit.org/show_bug.cgi?id=73960
+        <rdar://problem/10357008>
+
+        Reviewed by Darin Adler.
+
+        * DerivedSources.make: Moved notification files to its own directory. Need to add that path.
+        * WebKit2.xcodeproj/project.pbxproj: New header and impl files.
+        * Target.pri: Ditto.
+        * GNUmakefile.am: Ditto.
+        * win/WebKit2.vcproj: Ditto.
+        * win/WebKit2Common.vsprops: Add path to Notifications directory.
+
+        Implement permission functions, which go through permission request manager.
+
+        * WebProcess/WebCoreSupport/WebNotificationClient.cpp:
+        (WebKit::WebNotificationClient::requestPermission):
+        (WebKit::WebNotificationClient::cancelRequestsForPermission):
+        (WebKit::WebNotificationClient::checkPermission):
+
+        New NotificationPermissionRequestManager to make and cancel permission requests, and to retrieve current
+        policy.
+
+        * WebProcess/Notifications/NotificationPermissionRequestManager.cpp: Added.
+        (WebKit::generateRequestID):
+        (WebKit::NotificationPermissionRequestManager::create):
+        (WebKit::NotificationPermissionRequestManager::NotificationPermissionRequestManager):
+        (WebKit::NotificationPermissionRequestManager::startRequest): Keep track of the provided callback once
+        policy decision is made.
+        (WebKit::NotificationPermissionRequestManager::cancelRequest):
+        (WebKit::NotificationPermissionRequestManager::permissionLevel): Retrieve level through a synchronous
+        message to the proxy.
+        (WebKit::NotificationPermissionRequestManager::didReceiveNotificationPermissionDecision): Invoke the callback.
+        * WebProcess/Notifications/NotificationPermissionRequestManager.h: Added.
+        (WebKit::isRequestIDValid): Make sure any provided request IDs are valid.
+
+        Added new NotificationPermissionRequest class.
+
+        * UIProcess/Notifications/NotificationPermissionRequest.cpp: Added.
+        (WebKit::NotificationPermissionRequest::create):
+        (WebKit::NotificationPermissionRequest::NotificationPermissionRequest):
+        (WebKit::NotificationPermissionRequest::allow): Notify manager of decision.
+        (WebKit::NotificationPermissionRequest::deny): Ditto.
+        (WebKit::NotificationPermissionRequest::invalidate): Disassociate with manager.
+        (WebKit::NotificationPermissionRequest::type):
+        * UIProcess/Notifications/NotificationPermissionRequest.h: Added.
+
+        WKAPI support for NotificationPermissionRequest:
+
+        * Shared/API/c/WKBase.h:
+        * Shared/APIObject.h:
+        * UIProcess/API/C/WKAPICast.h:
+        * UIProcess/API/C/WKNotificationPermissionRequest.cpp: Added.
+        (WKNotificationPermissionRequestGetTypeID):
+        (WKNotificationPermissionRequestAllow):
+        (WKNotificationPermissionRequestDeny):
+        * UIProcess/API/C/WKNotificationPermissionRequest.h: Added.
+
+        Other additions to WK API:
+
+        * UIProcess/API/C/WKNotificationProvider.h: Added new callback for WKNotificationProviders, to return policy
+        for a given security origin.
+        * UIProcess/API/C/WKPage.h: Added new callback to WKPageUIClient to ask user to decide on policy.
+
+        New NotificationPermissionRequestManagerProxy to create requests.
+
+        * UIProcess/Notifications/NotificationPermissionRequestManagerProxy.cpp: Added.
+        (WebKit::NotificationPermissionRequestManagerProxy::NotificationPermissionRequestManagerProxy):
+        (WebKit::NotificationPermissionRequestManagerProxy::invalidateRequests):
+        (WebKit::NotificationPermissionRequestManagerProxy::createRequest):
+        (WebKit::NotificationPermissionRequestManagerProxy::didReceiveNotificationPermissionDecision):
+        * UIProcess/Notifications/NotificationPermissionRequestManagerProxy.h: Added.
+
+        Added new message to notification manager: NotificationPermissionLevel, to retrieve policy. The current
+        JS API retrieves the permission synchronously, so the message needs to be sent synchronously also.
+
+        * UIProcess/Notifications/WebNotificationManagerProxy.messages.in: Moved from Source/WebKit2/UIProcess/WebNotificationManagerProxy.messages.in.
+        * UIProcess/Notifications/WebNotificationProvider.cpp: Moved from Source/WebKit2/UIProcess/WebNotificationProvider.cpp.
+        (WebKit::WebNotificationProvider::policyForNotificationPermissionAtOrigin): Added.
+        * UIProcess/Notifications/WebNotificationProvider.h: Moved from Source/WebKit2/UIProcess/WebNotificationProvider.h.
+        * UIProcess/WebProcessProxy.cpp:
+        (WebKit::WebProcessProxy::didReceiveSyncMessage): Boilerplate to forward messages to notification manager.
+
+        * UIProcess/Notifications/WebNotificationManagerProxy.cpp: Moved from Source/WebKit2/UIProcess/WebNotificationManagerProxy.cpp.
+        (WebKit::WebNotificationManagerProxy::create):
+        (WebKit::WebNotificationManagerProxy::WebNotificationManagerProxy):
+        (WebKit::WebNotificationManagerProxy::invalidate):
+        (WebKit::WebNotificationManagerProxy::initializeProvider):
+        (WebKit::WebNotificationManagerProxy::didReceiveMessage):
+        (WebKit::WebNotificationManagerProxy::didReceiveSyncMessage):
+        (WebKit::WebNotificationManagerProxy::show):
+        (WebKit::WebNotificationManagerProxy::cancel):
+        (WebKit::WebNotificationManagerProxy::didDestroyNotification):
+        (WebKit::WebNotificationManagerProxy::notificationPermissionLevel): Retrieve the policy from the provider.
+        (WebKit::WebNotificationManagerProxy::providerDidShowNotification):
+        (WebKit::WebNotificationManagerProxy::providerDidClickNotification):
+        (WebKit::WebNotificationManagerProxy::providerDidCloseNotifications):
+        * UIProcess/Notifications/WebNotificationManagerProxy.h: Moved from Source/WebKit2/UIProcess/WebNotificationManagerProxy.h.
+        (WebKit::WebNotificationManagerProxy::clearContext):
+        (WebKit::WebNotificationManagerProxy::type):
+
+        Added NotificationPermissionRequestManagerProxy to WebPageProxy, to allow a request for permission to
+        go through to the UI client. Added new message to WebPageProxy, RequestNotificationPermission.
+
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::WebPageProxy):
+        (WebKit::WebPageProxy::close): Invalidate pending requests.
+        (WebKit::WebPageProxy::processDidCrash): Ditto.
+        (WebKit::WebPageProxy::requestNotificationPermission): Forward request to UI client.
+        * UIProcess/WebPageProxy.h:
+        * UIProcess/WebPageProxy.messages.in:
+
+        * UIProcess/WebUIClient.cpp:
+        (WebKit::WebUIClient::decidePolicyForNotificationPermissionRequest):
+        * UIProcess/WebUIClient.h:
+
+        Added new message DidReceiveNotificationPermissionDecision. The WebPage forwards the message to the
+        permission request manager.
+
+        * WebProcess/WebPage/WebPage.messages.in: Added new message DidReceiveNotificationPermissionDecision
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::notificationPermissionRequestManager): Create manager on request.
+        (WebKit::WebPage::didReceiveNotificationPermissionDecision):
+        * WebProcess/WebPage/WebPage.h:
+
+        Moving files to Notifications/ subdirectory.
+
+        * UIProcess/Notifications/WebNotification.cpp: Moved from Source/WebKit2/UIProcess/WebNotification.cpp.
+        * UIProcess/Notifications/WebNotification.h: Moved from Source/WebKit2/UIProcess/WebNotification.h.
+
 2011-12-08  Nayan Kumar K  <nayankk@motorola.com>
 
         [WebKit2] Initialize threading in UI process.
index a300f84..e2277e4 100644 (file)
@@ -40,6 +40,7 @@ VPATH = \
     $(WebKit2)/WebProcess \
     $(WebKit2)/UIProcess \
     $(WebKit2)/UIProcess/Downloads \
+    $(WebKit2)/UIProcess/Notifications \
     $(WebKit2)/UIProcess/Plugins \
 #
 
index 214db55..5927106 100644 (file)
@@ -57,11 +57,12 @@ libwebkit2gtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_HEA
        $(WebKit2)/UIProcess/API/C/WKInspector.h \
        $(WebKit2)/UIProcess/API/C/WKKeyValueStorageManager.h \
        $(WebKit2)/UIProcess/API/C/WKMediaCacheManager.h \
+       $(WebKit2)/UIProcess/API/C/WKNativeEvent.h \
+       $(WebKit2)/UIProcess/API/C/WKNavigationData.h \
        $(WebKit2)/UIProcess/API/C/WKNotification.h \
        $(WebKit2)/UIProcess/API/C/WKNotificationManager.h \
+       $(WebKit2)/UIProcess/API/C/WKNotificationPermissionRequest.h \
        $(WebKit2)/UIProcess/API/C/WKNotificationProvider.h \
-       $(WebKit2)/UIProcess/API/C/WKNativeEvent.h \
-       $(WebKit2)/UIProcess/API/C/WKNavigationData.h \
        $(WebKit2)/UIProcess/API/C/WKOpenPanelParameters.h \
        $(WebKit2)/UIProcess/API/C/WKOpenPanelResultListener.h \
        $(WebKit2)/UIProcess/API/C/WKPageGroup.h \
@@ -485,6 +486,8 @@ libwebkit2gtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_SOU
        Source/WebKit2/UIProcess/API/C/WKNotification.h \
        Source/WebKit2/UIProcess/API/C/WKNotificationManager.cpp \
        Source/WebKit2/UIProcess/API/C/WKNotificationManager.h \
+       Source/WebKit2/UIProcess/API/C/WKNotificationPermissionRequest.cpp \
+       Source/WebKit2/UIProcess/API/C/WKNotificationPermissionRequest.h \
        Source/WebKit2/UIProcess/API/C/WKNotificationProvider.h \
        Source/WebKit2/UIProcess/API/C/WKOpenPanelParameters.cpp \
        Source/WebKit2/UIProcess/API/C/WKOpenPanelParameters.h \
@@ -581,6 +584,16 @@ libwebkit2gtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_SOU
        Source/WebKit2/UIProcess/Launcher/ProcessLauncher.h \
        Source/WebKit2/UIProcess/Launcher/ThreadLauncher.cpp \
        Source/WebKit2/UIProcess/Launcher/ThreadLauncher.h \
+       Source/WebKit2/UIProcess/Notifications/NotificationPermissionRequest.cpp \
+       Source/WebKit2/UIProcess/Notifications/NotificationPermissionRequest.h \
+       Source/WebKit2/UIProcess/Notifications/NotificationPermissionRequestManagerProxy.cpp \
+       Source/WebKit2/UIProcess/Notifications/NotificationPermissionRequestManagerProxy.h \
+       Source/WebKit2/UIProcess/Notifications/WebNotification.cpp \
+       Source/WebKit2/UIProcess/Notifications/WebNotification.h \
+       Source/WebKit2/UIProcess/Notifications/WebNotificationManagerProxy.cpp \
+       Source/WebKit2/UIProcess/Notifications/WebNotificationManagerProxy.h \
+       Source/WebKit2/UIProcess/Notifications/WebNotificationProvider.cpp \
+       Source/WebKit2/UIProcess/Notifications/WebNotificationProvider.h \
        Source/WebKit2/UIProcess/PageClient.h \
        Source/WebKit2/UIProcess/Plugins/PluginInfoStore.cpp \
        Source/WebKit2/UIProcess/Plugins/PluginInfoStore.h \
@@ -659,12 +672,6 @@ libwebkit2gtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_SOU
        Source/WebKit2/UIProcess/WebKeyValueStorageManagerProxy.h \
        Source/WebKit2/UIProcess/WebMediaCacheManagerProxy.cpp \
        Source/WebKit2/UIProcess/WebMediaCacheManagerProxy.h \
-       Source/WebKit2/UIProcess/WebNotification.cpp \
-       Source/WebKit2/UIProcess/WebNotification.h \
-       Source/WebKit2/UIProcess/WebNotificationManagerProxy.cpp \
-       Source/WebKit2/UIProcess/WebNotificationManagerProxy.h \
-       Source/WebKit2/UIProcess/WebNotificationProvider.cpp \
-       Source/WebKit2/UIProcess/WebNotificationProvider.h \
        Source/WebKit2/UIProcess/WebLoaderClient.cpp \
        Source/WebKit2/UIProcess/WebLoaderClient.h \
        Source/WebKit2/UIProcess/WebNavigationData.cpp \
@@ -795,6 +802,8 @@ libwebkit2gtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_SOU
        Source/WebKit2/WebProcess/KeyValueStorage/WebKeyValueStorageManager.h \
        Source/WebKit2/WebProcess/MediaCache/WebMediaCacheManager.cpp \
        Source/WebKit2/WebProcess/MediaCache/WebMediaCacheManager.h \
+       Source/WebKit2/WebProcess/Notifications/NotificationPermissionRequestManager.cpp \
+       Source/WebKit2/WebProcess/Notifications/NotificationPermissionRequestManager.h \
        Source/WebKit2/WebProcess/Notifications/WebNotificationManager.cpp \
        Source/WebKit2/WebProcess/Notifications/WebNotificationManager.h \
        Source/WebKit2/WebProcess/Plugins/Netscape/JSNPMethod.cpp \
@@ -933,6 +942,7 @@ libwebkit2gtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_CPP
        -I$(srcdir)/Source/WebKit2/UIProcess/gtk \
        -I$(srcdir)/Source/WebKit2/UIProcess/Launcher \
        -I$(srcdir)/Source/WebKit2/UIProcess/Launcher/gtk \
+       -I$(srcdir)/Source/WebKit2/UIProcess/Notifications \
        -I$(srcdir)/Source/WebKit2/UIProcess/Plugins \
        -I$(srcdir)/Source/WebKit2/UIProcess/Plugins/gtk \
        -I$(srcdir)/Source/WebKit2/WebProcess \
@@ -1059,6 +1069,7 @@ vpath %.messages.in = \
        $(WebKit2)/UIProcess/ApplicationCache \
        $(WebKit2)/UIProcess/Downloads \
        $(WebKit2)/UIProcess/Geolocation \
+       $(WebKit2)/UIProcess/Notifications \
        $(WebKit2)/UIProcess/Plugins \
        $(WebKit2)/UIProcess/ResourceCache \
        $(WebKit2)/WebProcess \
@@ -1453,6 +1464,7 @@ EXTRA_DIST += \
        $(shell ls $(WebKit2)/Shared/Plugins/*.in) \
        $(shell ls $(WebKit2)/UIProcess/*.in) \
        $(shell ls $(WebKit2)/UIProcess/Downloads/*.in) \
+       $(shell ls $(WebKit2)/UIProcess/Notifications/*.in) \
        $(shell ls $(WebKit2)/UIProcess/Plugins/*.in) \
        $(shell ls $(WebKit2)/WebProcess/*.in) \
        $(shell ls $(WebKit2)/WebProcess/ApplicationCache/*.in) \
@@ -1463,6 +1475,7 @@ EXTRA_DIST += \
        $(shell ls $(WebKit2)/WebProcess/IconDatabase/*.in) \
        $(shell ls $(WebKit2)/WebProcess/KeyValueStorage/*.in) \
        $(shell ls $(WebKit2)/WebProcess/MediaCache/*.in) \
+       $(shell ls $(WebKit2)/WebProcess/Notifications/*.in) \
        $(shell ls $(WebKit2)/WebProcess/Plugins/*.in) \
        $(shell ls $(WebKit2)/WebProcess/ResourceCache/*.in) \
        $(shell ls $(WebKit2)/WebProcess/WebCoreSupport/*.in) \
index 6cf4f0f..adbce6d 100644 (file)
@@ -97,6 +97,7 @@ typedef const struct OpaqueWKMediaCacheManager* WKMediaCacheManagerRef;
 typedef const struct OpaqueWKNavigationData* WKNavigationDataRef;
 typedef const struct OpaqueWKNotification* WKNotificationRef;
 typedef const struct OpaqueWKNotificationManager* WKNotificationManagerRef;
+typedef const struct OpaqueWKNotificationPermissionRequest* WKNotificationPermissionRequestRef;
 typedef const struct OpaqueWKNotificationProvider* WKNotificationProviderRef;
 typedef const struct OpaqueWKOpenPanelParameters* WKOpenPanelParametersRef;
 typedef const struct OpaqueWKOpenPanelResultListener* WKOpenPanelResultListenerRef;
index 0f4f4a3..183cea0 100644 (file)
@@ -91,6 +91,7 @@ public:
         TypeNavigationData,
         TypeNotification,
         TypeNotificationManager,
+        TypeNotificationPermissionRequest,
         TypeOpenPanelParameters,
         TypeOpenPanelResultListener,
         TypePage,
index b8451c7..a5d4c6d 100644 (file)
@@ -157,6 +157,7 @@ HEADERS += \
     UIProcess/API/C/WKNavigationData.h \
     UIProcess/API/C/WKNotification.h \
     UIProcess/API/C/WKNotificationManager.h \
+    UIProcess/API/C/WKNotificationPermissionRequest.h \
     UIProcess/API/C/WKNotificationProvider.h \
     UIProcess/API/C/WKPage.h \
     UIProcess/API/C/WKPageGroup.h \
@@ -194,6 +195,11 @@ HEADERS += \
     UIProcess/GeolocationPermissionRequestProxy.h \
     UIProcess/Launcher/ProcessLauncher.h \
     UIProcess/Launcher/ThreadLauncher.h \
+    UIProcess/Notifications/NotificationPermissionRequest.h \
+    UIProcess/Notifications/NotificationPermissionRequestManagerProxy.h \
+    UIProcess/Notifications/WebNotification.h \
+    UIProcess/Notifications/WebNotificationManagerProxy.h \
+    UIProcess/Notifications/WebNotificationProvider.h \
     UIProcess/PageClient.h \
     UIProcess/Plugins/PluginInfoStore.h \
     UIProcess/Plugins/PluginProcessProxy.h \
@@ -232,9 +238,6 @@ HEADERS += \
     UIProcess/WebLoaderClient.h \
     UIProcess/WebMediaCacheManagerProxy.h \
     UIProcess/WebNavigationData.h \
-    UIProcess/WebNotification.h \
-    UIProcess/WebNotificationManagerProxy.h \
-    UIProcess/WebNotificationProvider.h \
     UIProcess/WebOpenPanelResultListenerProxy.h \
     UIProcess/WebPageContextMenuClient.h \
     UIProcess/WebPageGroup.h \
@@ -304,6 +307,7 @@ HEADERS += \
     WebProcess/InjectedBundle/InjectedBundleUserMessageCoders.h \
     WebProcess/KeyValueStorage/WebKeyValueStorageManager.h \
     WebProcess/MediaCache/WebMediaCacheManager.h \
+    WebProcess/Notifications/NotificationPermissionRequestManager.h \
     WebProcess/Notifications/WebNotificationManager.h \
     WebProcess/ResourceCache/WebResourceCacheManager.h \
     WebProcess/Plugins/Netscape/JSNPMethod.h \
@@ -477,6 +481,7 @@ SOURCES += \
     UIProcess/API/C/WKInspector.cpp \
     UIProcess/API/C/WKNotification.cpp \
     UIProcess/API/C/WKNotificationManager.cpp \
+    UIProcess/API/C/WKNotificationPermissionRequest.cpp \
     UIProcess/API/C/WKOpenPanelParameters.cpp \
     UIProcess/API/C/WKOpenPanelResultListener.cpp \
     UIProcess/API/C/WKNavigationData.cpp \
@@ -510,6 +515,11 @@ SOURCES += \
     UIProcess/Launcher/ThreadLauncher.cpp \
     UIProcess/Launcher/qt/ProcessLauncherQt.cpp \
     UIProcess/Launcher/qt/ThreadLauncherQt.cpp \
+    UIProcess/Notifications/NotificationPermissionRequest.cpp \
+    UIProcess/Notifications/NotificationPermissionRequestManagerProxy.cpp \
+    UIProcess/Notifications/WebNotification.cpp \
+    UIProcess/Notifications/WebNotificationManagerProxy.cpp \
+    UIProcess/Notifications/WebNotificationProvider.cpp \
     UIProcess/Plugins/PluginInfoStore.cpp \
     UIProcess/Plugins/PluginProcessProxy.cpp \
     UIProcess/Plugins/PluginProcessManager.cpp \
@@ -548,9 +558,6 @@ SOURCES += \
     UIProcess/WebLoaderClient.cpp \
     UIProcess/WebMediaCacheManagerProxy.cpp \
     UIProcess/WebNavigationData.cpp \
-    UIProcess/WebNotification.cpp \
-    UIProcess/WebNotificationManagerProxy.cpp \
-    UIProcess/WebNotificationProvider.cpp \
     UIProcess/WebOpenPanelResultListenerProxy.cpp \
     UIProcess/WebPageContextMenuClient.cpp \
     UIProcess/WebPageGroup.cpp \
@@ -636,6 +643,7 @@ SOURCES += \
     WebProcess/InjectedBundle/qt/InjectedBundleQt.cpp \
     WebProcess/KeyValueStorage/WebKeyValueStorageManager.cpp \
     WebProcess/MediaCache/WebMediaCacheManager.cpp \
+    WebProcess/Notifications/NotificationPermissionRequestManager.cpp \
     WebProcess/Notifications/WebNotificationManager.cpp \
     WebProcess/ResourceCache/WebResourceCacheManager.cpp \
     WebProcess/Plugins/Netscape/JSNPMethod.cpp \
index 9777c1a..0e7175a 100644 (file)
@@ -52,6 +52,7 @@ class AuthenticationChallengeProxy;
 class AuthenticationDecisionListener;
 class DownloadProxy;
 class GeolocationPermissionRequestProxy;
+class NotificationPermissionRequest;
 class WebApplicationCacheManagerProxy;
 class WebBackForwardList;
 class WebBackForwardListItem;
@@ -108,6 +109,7 @@ WK_ADD_API_MAPPING(WKKeyValueStorageManagerRef, WebKeyValueStorageManagerProxy)
 WK_ADD_API_MAPPING(WKMediaCacheManagerRef, WebMediaCacheManagerProxy)
 WK_ADD_API_MAPPING(WKNavigationDataRef, WebNavigationData)
 WK_ADD_API_MAPPING(WKNotificationManagerRef, WebNotificationManagerProxy)
+WK_ADD_API_MAPPING(WKNotificationPermissionRequestRef, NotificationPermissionRequest)
 WK_ADD_API_MAPPING(WKNotificationProviderRef, WebNotificationProvider)
 WK_ADD_API_MAPPING(WKNotificationRef, WebNotification)
 WK_ADD_API_MAPPING(WKOpenPanelParametersRef, WebOpenPanelParameters)
diff --git a/Source/WebKit2/UIProcess/API/C/WKNotificationPermissionRequest.cpp b/Source/WebKit2/UIProcess/API/C/WKNotificationPermissionRequest.cpp
new file mode 100644 (file)
index 0000000..596348d
--- /dev/null
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2011 Apple Inc. All rights reserved.
+ *
+ * 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 "WKNotificationPermissionRequest.h"
+
+#include "NotificationPermissionRequest.h"
+#include "WKAPICast.h"
+
+using namespace WebKit;
+
+WKTypeID WKNotificationPermissionRequestGetTypeID()
+{
+    return toAPI(NotificationPermissionRequest::APIType);
+}
+
+void WKNotificationPermissionRequestAllow(WKNotificationPermissionRequestRef notificationPermissionRequest)
+{
+    return toImpl(notificationPermissionRequest)->allow();
+}
+
+void WKNotificationPermissionRequestDeny(WKNotificationPermissionRequestRef notificationPermissionRequest)
+{
+    return toImpl(notificationPermissionRequest)->deny();
+}
diff --git a/Source/WebKit2/UIProcess/API/C/WKNotificationPermissionRequest.h b/Source/WebKit2/UIProcess/API/C/WKNotificationPermissionRequest.h
new file mode 100644 (file)
index 0000000..1947a06
--- /dev/null
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 2011 Apple Inc. All rights reserved.
+ *
+ * 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.
+ */
+
+#ifndef WKNotificationPermissionRequest_h
+#define WKNotificationPermissionRequest_h
+
+#include <WebKit2/WKBase.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+WK_EXPORT WKTypeID WKNotificationPermissionRequestGetTypeID();
+
+WK_EXPORT void WKNotificationPermissionRequestAllow(WKNotificationPermissionRequestRef notificationPermissionRequest);
+WK_EXPORT void WKNotificationPermissionRequestDeny(WKNotificationPermissionRequestRef notificationPermissionRequest);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // WKNotificationPermissionRequest_h
index 6fa65bb..704813f 100644 (file)
@@ -35,17 +35,19 @@ extern "C" {
 typedef void (*WKNotificationProviderShowCallback)(WKNotificationRef notification, const void* clientInfo);
 typedef void (*WKNotificationProviderCancelCallback)(WKNotificationRef notification, const void* clientInfo);
 typedef void (*WKNotificationProviderDidDestroyNotificationCallback)(WKNotificationRef notification, const void* clientInfo);
+typedef int (*WKNotificationProviderPolicyForNotificationPermissionAtOriginCallback)(WKSecurityOriginRef origin, const void *clientInfo);
 typedef void (*WKNotificationProviderAddNotificationManagerCallback)(WKNotificationManagerRef manager, const void* clientInfo);
 typedef void (*WKNotificationProviderRemoveNotificationManagerCallback)(WKNotificationManagerRef manager, const void* clientInfo);
 
 struct WKNotificationProvider {
-    int                                                       version;
-    const void*                                               clientInfo;
-    WKNotificationProviderShowCallback                        show;
-    WKNotificationProviderCancelCallback                      cancel;
-    WKNotificationProviderDidDestroyNotificationCallback      didDestroyNotification;
-    WKNotificationProviderAddNotificationManagerCallback      addNotificationManager;
-    WKNotificationProviderRemoveNotificationManagerCallback   removeNotificationManager;
+    int                                                                   version;
+    const void*                                                           clientInfo;
+    WKNotificationProviderShowCallback                                    show;
+    WKNotificationProviderCancelCallback                                  cancel;
+    WKNotificationProviderDidDestroyNotificationCallback                  didDestroyNotification;
+    WKNotificationProviderPolicyForNotificationPermissionAtOriginCallback policyForNotificationPermissionAtOrigin;
+    WKNotificationProviderAddNotificationManagerCallback                  addNotificationManager;
+    WKNotificationProviderRemoveNotificationManagerCallback               removeNotificationManager;
 };
 typedef struct WKNotificationProvider WKNotificationProvider;
 
index cb5ad2f..1de7062 100644 (file)
@@ -197,6 +197,7 @@ typedef void (*WKPageDrawFooterCallback)(WKPageRef page, WKFrameRef frame, WKRec
 typedef void (*WKPagePrintFrameCallback)(WKPageRef page, WKFrameRef frame, const void* clientInfo);
 typedef void (*WKPageSaveDataToFileInDownloadsFolderCallback)(WKPageRef page, WKStringRef suggestedFilename, WKStringRef mimeType, WKURLRef originatingURL, WKDataRef data, const void* clientInfo);
 typedef bool (*WKPageShouldInterruptJavaScriptCallback)(WKPageRef page, const void *clientInfo);
+typedef void (*WKPageDecidePolicyForNotificationPermissionRequestCallback)(WKPageRef page, WKSecurityOriginRef origin, WKNotificationPermissionRequestRef permissionRequest, const void *clientInfo);
 
 // Deprecated    
 typedef WKPageRef (*WKPageCreateNewPageCallback_deprecatedForUseWithV0)(WKPageRef page, WKDictionaryRef features, WKEventModifiers modifiers, WKEventMouseButton mouseButton, const void *clientInfo);
@@ -250,6 +251,7 @@ struct WKPageUIClient {
     // Version 1
     WKPageCreateNewPageCallback                                         createNewPage;
     WKPageMouseDidMoveOverElementCallback                               mouseDidMoveOverElement;
+    WKPageDecidePolicyForNotificationPermissionRequestCallback          decidePolicyForNotificationPermissionRequest;
 };
 typedef struct WKPageUIClient WKPageUIClient;
 
diff --git a/Source/WebKit2/UIProcess/Notifications/NotificationPermissionRequest.cpp b/Source/WebKit2/UIProcess/Notifications/NotificationPermissionRequest.cpp
new file mode 100644 (file)
index 0000000..25d37da
--- /dev/null
@@ -0,0 +1,67 @@
+/*
+ * Copyright (C) 2011 Apple Inc. All rights reserved.
+ *
+ * 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 "NotificationPermissionRequest.h"
+
+#include "NotificationPermissionRequestManagerProxy.h"
+
+namespace WebKit {
+    
+PassRefPtr<NotificationPermissionRequest> NotificationPermissionRequest::create(WebKit::NotificationPermissionRequestManagerProxy *manager, uint64_t notificationID)
+{
+    return adoptRef(new NotificationPermissionRequest(manager, notificationID));
+}
+
+NotificationPermissionRequest::NotificationPermissionRequest(NotificationPermissionRequestManagerProxy* manager, uint64_t notificationID)
+    : m_manager(manager)
+    , m_notificationID(notificationID)
+{
+}
+
+void NotificationPermissionRequest::allow()
+{
+    if (!m_manager)
+        return;
+    
+    m_manager->didReceiveNotificationPermissionDecision(m_notificationID, true);
+    m_manager = 0;
+}
+
+void NotificationPermissionRequest::deny()
+{
+    if (!m_manager)
+        return;
+    
+    m_manager->didReceiveNotificationPermissionDecision(m_notificationID, false);
+    m_manager = 0;
+}
+
+void NotificationPermissionRequest::invalidate()
+{
+    m_manager = 0;
+}
+
+} // namespace WebKit
diff --git a/Source/WebKit2/UIProcess/Notifications/NotificationPermissionRequest.h b/Source/WebKit2/UIProcess/Notifications/NotificationPermissionRequest.h
new file mode 100644 (file)
index 0000000..24db98b
--- /dev/null
@@ -0,0 +1,58 @@
+/*
+ * Copyright (C) 2011 Apple Inc. All rights reserved.
+ *
+ * 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.
+ */
+
+#ifndef NotificationPermissionRequest_h
+#define NotificationPermissionRequest_h
+
+#include "APIObject.h"
+#include <wtf/PassRefPtr.h>
+
+namespace WebKit {
+
+class NotificationPermissionRequestManagerProxy;
+
+class NotificationPermissionRequest : public APIObject {
+public:
+    static const Type APIType = TypeNotificationPermissionRequest;
+    
+    static PassRefPtr<NotificationPermissionRequest> create(NotificationPermissionRequestManagerProxy*, uint64_t notificationID);
+    
+    void allow();
+    void deny();
+    
+    void invalidate();
+    
+private:
+    NotificationPermissionRequest(NotificationPermissionRequestManagerProxy*, uint64_t notificationID);
+    
+    virtual Type type() const { return APIType; }
+    
+    NotificationPermissionRequestManagerProxy* m_manager;
+    uint64_t m_notificationID;    
+};
+
+} // namespace WebKit
+
+#endif // NotificationPermissionRequestProxy_h
diff --git a/Source/WebKit2/UIProcess/Notifications/NotificationPermissionRequestManagerProxy.cpp b/Source/WebKit2/UIProcess/Notifications/NotificationPermissionRequestManagerProxy.cpp
new file mode 100644 (file)
index 0000000..0792298
--- /dev/null
@@ -0,0 +1,70 @@
+/*
+ * Copyright (C) 2011 Apple Inc. All rights reserved.
+ *
+ * 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 "NotificationPermissionRequestManagerProxy.h"
+
+#include "NotificationPermissionRequest.h"
+#include "WebPageMessages.h"
+#include "WebPageProxy.h"
+#include "WebProcessProxy.h"
+
+namespace WebKit {
+
+NotificationPermissionRequestManagerProxy::NotificationPermissionRequestManagerProxy(WebPageProxy* page)
+    : m_page(page)
+{
+}
+
+void NotificationPermissionRequestManagerProxy::invalidateRequests()
+{
+    PendingRequestMap::const_iterator it = m_pendingRequests.begin();
+    PendingRequestMap::const_iterator end = m_pendingRequests.end();
+    for (; it != end; ++it)
+        it->second->invalidate();
+    
+    m_pendingRequests.clear();
+}
+
+PassRefPtr<NotificationPermissionRequest> NotificationPermissionRequestManagerProxy::createRequest(uint64_t notificationID)
+{
+    RefPtr<NotificationPermissionRequest> request = NotificationPermissionRequest::create(this, notificationID);
+    m_pendingRequests.add(notificationID, request.get());
+    return request.release();
+}
+
+void NotificationPermissionRequestManagerProxy::didReceiveNotificationPermissionDecision(uint64_t notificationID, bool allow)
+{
+    if (!m_page->isValid())
+        return;
+    
+    RefPtr<NotificationPermissionRequest> request = m_pendingRequests.take(notificationID);
+    if (!request)
+        return;
+    
+    m_page->process()->send(Messages::WebPage::DidReceiveNotificationPermissionDecision(notificationID, allow), m_page->pageID());
+}
+
+} // namespace WebKit
diff --git a/Source/WebKit2/UIProcess/Notifications/NotificationPermissionRequestManagerProxy.h b/Source/WebKit2/UIProcess/Notifications/NotificationPermissionRequestManagerProxy.h
new file mode 100644 (file)
index 0000000..f6228e7
--- /dev/null
@@ -0,0 +1,59 @@
+/*
+ * Copyright (C) 2011 Apple Inc. All rights reserved.
+ *
+ * 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.
+ */
+
+#ifndef NotificationPermissionRequestManagerProxy_h
+#define NotificationPermissionRequestManagerProxy_h
+
+#include "NotificationPermissionRequest.h"
+#include <wtf/HashMap.h>
+#include <wtf/RefPtr.h>
+
+namespace WebKit {
+
+class GeolocationPermissionRequestProxy;
+class WebPageProxy;
+
+class NotificationPermissionRequestManagerProxy {
+public:
+    explicit NotificationPermissionRequestManagerProxy(WebPageProxy*);
+    
+    void invalidateRequests();
+    
+    // Create a request to be presented to the user.
+    PassRefPtr<NotificationPermissionRequest> createRequest(uint64_t notificationID);
+    
+    // Called by NotificationPermissionRequest when a decision is made by the user.
+    void didReceiveNotificationPermissionDecision(uint64_t notificationID, bool allow);
+    
+private:
+    typedef HashMap<uint64_t, RefPtr<NotificationPermissionRequest> > PendingRequestMap;
+    PendingRequestMap m_pendingRequests;
+    WebPageProxy* m_page;
+};
+
+} // namespace WebKit
+
+
+#endif // NotificationPermissionRequestManagerProxy_h
 
 namespace WebKit {
 
-WebNotification::WebNotification()
-{
-}
-
 WebNotification::WebNotification(const String& title, const String& body, uint64_t notificationID)
     : m_title(title)
     , m_body(body)
@@ -44,10 +40,6 @@ WebNotification::WebNotification(const String& title, const String& body, uint64
 {
 }
 
-WebNotification::~WebNotification()
-{
-}
-
 void WebNotification::encode(CoreIPC::ArgumentEncoder* encoder) const
 {
     encoder->encode(CoreIPC::In(m_title, m_body, m_notificationID));
@@ -43,12 +43,10 @@ class WebNotification : public APIObject {
 public:
     static const Type APIType = TypeNotification;
     
-    WebNotification();
     static PassRefPtr<WebNotification> create(const String& title, const String& body, uint64_t notificationID)
     {
         return adoptRef(new WebNotification(title, body, notificationID));
     }
-    virtual ~WebNotification();
     
     const String& title() const { return m_title; }
     
@@ -30,6 +30,7 @@
 #include "WebContext.h"
 #include "WebNotification.h"
 #include "WebNotificationManagerMessages.h"
+#include "WebSecurityOrigin.h"
 #include <WebCore/NotificationContents.h>
 
 using namespace WTF;
@@ -47,10 +48,6 @@ WebNotificationManagerProxy::WebNotificationManagerProxy(WebContext* context)
 {
 }
 
-WebNotificationManagerProxy::~WebNotificationManagerProxy()
-{
-}
-
 void WebNotificationManagerProxy::invalidate()
 {
     m_provider.removeNotificationManager(this);
@@ -66,6 +63,11 @@ void WebNotificationManagerProxy::didReceiveMessage(CoreIPC::Connection* connect
     didReceiveWebNotificationManagerProxyMessage(connection, messageID, arguments);
 }
 
+void WebNotificationManagerProxy::didReceiveSyncMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments, OwnPtr<CoreIPC::ArgumentEncoder>& reply)
+{
+    didReceiveSyncWebNotificationManagerProxyMessage(connection, messageID, arguments, reply);
+}
+
 void WebNotificationManagerProxy::show(const String& title, const String& body, uint64_t notificationID)
 {
     if (!isNotificationIDValid(notificationID))
@@ -103,6 +105,12 @@ void WebNotificationManagerProxy::didDestroyNotification(uint64_t notificationID
     m_provider.didDestroyNotification(notification.get());
 }
 
+void WebNotificationManagerProxy::notificationPermissionLevel(const String& originIdentifier, uint64_t& permissionLevel)
+{
+    RefPtr<WebSecurityOrigin> origin = WebSecurityOrigin::create(originIdentifier);
+    permissionLevel = m_provider.policyForNotificationPermissionAtOrigin(origin.get());
+}
+
 void WebNotificationManagerProxy::providerDidShowNotification(uint64_t notificationID)
 {
     if (!m_context)
 #include "MessageID.h"
 #include "WebNotificationProvider.h"
 #include <wtf/HashMap.h>
+#include <wtf/OwnPtr.h>
 #include <wtf/PassRefPtr.h>
 
 namespace CoreIPC {
 class ArgumentDecoder;
+class ArgumentEncoder;
 class Connection;
 }
 
@@ -47,7 +49,6 @@ public:
     static const Type APIType = TypeNotificationManager;
     
     static PassRefPtr<WebNotificationManagerProxy> create(WebContext*);
-    virtual ~WebNotificationManagerProxy();
     
     void invalidate();
     void clearContext() { m_context = 0; }
@@ -59,6 +60,7 @@ public:
     void providerDidCloseNotifications(ImmutableArray* notificationIDs);
     
     void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
+    void didReceiveSyncMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*, OwnPtr<CoreIPC::ArgumentEncoder>&);
 
 private:
     explicit WebNotificationManagerProxy(WebContext*);
@@ -66,12 +68,14 @@ private:
     virtual Type type() const { return APIType; }
     
     void didReceiveWebNotificationManagerProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
+    void didReceiveSyncWebNotificationManagerProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*, OwnPtr<CoreIPC::ArgumentEncoder>&);
     
     // Message handlers
     void show(const WTF::String& title, const WTF::String& body, uint64_t notificationID);
     void cancel(uint64_t notificationID);
     void didDestroyNotification(uint64_t notificationID);
-    
+    void notificationPermissionLevel(const WTF::String& originIdentifier, uint64_t& permissionLevel);
+
     typedef HashMap<uint64_t, RefPtr<WebNotification> > WebNotificationMap;
     
     WebContext* m_context;
@@ -24,4 +24,6 @@ messages -> WebNotificationManagerProxy {
     Show(WTF::String title, WTF::String body, uint64_t notificationID);
     Cancel(uint64_t notificationID);
     DidDestroyNotification(uint64_t notificationID);
+
+    NotificationPermissionLevel(WTF::String originIdentifier) -> (uint64_t policy)
 }
@@ -29,6 +29,7 @@
 #include "WKAPICast.h"
 #include "WebNotification.h"
 #include "WebNotificationManagerProxy.h"
+#include "WebSecurityOrigin.h"
 
 namespace WebKit {
 
@@ -56,6 +57,14 @@ void WebNotificationProvider::didDestroyNotification(WebNotification* notificati
     m_client.didDestroyNotification(toAPI(notification), m_client.clientInfo);
 }
 
+int WebNotificationProvider::policyForNotificationPermissionAtOrigin(WebSecurityOrigin* origin)
+{
+    if (!m_client.policyForNotificationPermissionAtOrigin)
+        return INT_MIN;
+    
+    return m_client.policyForNotificationPermissionAtOrigin(toAPI(origin), m_client.clientInfo);
+}
+
 void WebNotificationProvider::addNotificationManager(WebNotificationManagerProxy* manager)
 {
     if (!m_client.addNotificationManager)
@@ -34,12 +34,14 @@ namespace WebKit {
 
 class WebNotification;
 class WebNotificationManagerProxy;
+class WebSecurityOrigin;
     
 class WebNotificationProvider : public APIClient<WKNotificationProvider, kWKNotificationProviderCurrentVersion> {
 public:
     void show(WebNotification*);
     void cancel(WebNotification*);
     void didDestroyNotification(WebNotification*);
+    int policyForNotificationPermissionAtOrigin(WebSecurityOrigin*);
 
     void addNotificationManager(WebNotificationManagerProxy*);
     void removeNotificationManager(WebNotificationManagerProxy*);
index b977d88..eff6611 100644 (file)
@@ -37,6 +37,8 @@
 #include "NativeWebKeyboardEvent.h"
 #include "NativeWebMouseEvent.h"
 #include "NativeWebWheelEvent.h"
+#include "NotificationPermissionRequest.h"
+#include "NotificationPermissionRequestManager.h"
 #include "PageClient.h"
 #include "PrintInfo.h"
 #include "SessionState.h"
@@ -146,6 +148,7 @@ WebPageProxy::WebPageProxy(PageClient* pageClient, PassRefPtr<WebProcessProxy> p
     , m_mainFrame(0)
     , m_userAgent(standardUserAgent())
     , m_geolocationPermissionRequestManager(this)
+    , m_notificationPermissionRequestManager(this)
     , m_estimatedProgress(0)
     , m_isInWindow(m_pageClient->isViewInWindow())
     , m_isVisible(m_pageClient->isViewVisible())
@@ -364,6 +367,7 @@ void WebPageProxy::close()
     }
 
     m_geolocationPermissionRequestManager.invalidateRequests();
+    m_notificationPermissionRequestManager.invalidateRequests();
 
     m_toolTip = String();
 
@@ -3133,6 +3137,7 @@ void WebPageProxy::processDidCrash()
     }
 
     m_geolocationPermissionRequestManager.invalidateRequests();
+    m_notificationPermissionRequestManager.invalidateRequests();
 
     m_toolTip = String();
 
@@ -3295,6 +3300,18 @@ void WebPageProxy::requestGeolocationPermissionForFrame(uint64_t geolocationID,
         request->deny();
 }
 
+void WebPageProxy::requestNotificationPermission(uint64_t requestID, const String& originIdentifier)
+{
+    if (!isRequestIDValid(requestID))
+        return;
+
+    RefPtr<WebSecurityOrigin> origin = WebSecurityOrigin::create(originIdentifier);
+    RefPtr<NotificationPermissionRequest> request = m_notificationPermissionRequestManager.createRequest(requestID);
+    
+    if (!m_uiClient.decidePolicyForNotificationPermissionRequest(this, origin.get(), request.get()))
+        request->deny();
+}
+
 float WebPageProxy::headerHeight(WebFrameProxy* frame)
 {
     return m_uiClient.headerHeight(this, frame);
index 8255cf4..47fcd6c 100644 (file)
@@ -36,6 +36,7 @@
 #if ENABLE(TOUCH_EVENTS)
 #include "NativeWebTouchEvent.h"
 #endif
+#include "NotificationPermissionRequestManagerProxy.h"
 #include "PlatformProcessIdentifier.h"
 #include "SandboxExtension.h"
 #include "ShareableBitmap.h"
@@ -685,6 +686,8 @@ private:
     void reattachToWebProcess();
     void reattachToWebProcessWithItem(WebBackForwardListItem*);
 
+    void requestNotificationPermission(uint64_t notificationID, const String& originIdentifier);
+    
 #if USE(TILED_BACKING_STORE)
     void pageDidRequestScroll(const WebCore::IntPoint&);
 #endif
@@ -869,6 +872,7 @@ private:
     ContextMenuState m_activeContextMenuState;
     RefPtr<WebOpenPanelResultListenerProxy> m_openPanelResultListener;
     GeolocationPermissionRequestManagerProxy m_geolocationPermissionRequestManager;
+    NotificationPermissionRequestManagerProxy m_notificationPermissionRequestManager;
 
     double m_estimatedProgress;
 
index 6d2ab39..5e3d698 100644 (file)
@@ -194,6 +194,9 @@ messages -> WebPageProxy {
 
     # Geolocation messages
     RequestGeolocationPermissionForFrame(uint64_t geolocationID, uint64_t frameID, WTF::String originIdentifier)
+    
+    # Notification messages
+    RequestNotificationPermission(uint64_t requestID, WTF::String originIdentifier)
 
     # Spelling and grammar messages
 #if USE(UNIFIED_TEXT_CHECKING)  
index 0b2b187..0c11caa 100644 (file)
@@ -34,6 +34,7 @@
 #include "WebBackForwardListItem.h"
 #include "WebContext.h"
 #include "WebNavigationDataStore.h"
+#include "WebNotificationManagerProxy.h"
 #include "WebPageProxy.h"
 #include "WebProcessMessages.h"
 #include "WebProcessProxyMessages.h"
@@ -332,6 +333,11 @@ void WebProcessProxy::didReceiveSyncMessage(CoreIPC::Connection* connection, Cor
         return;
     }
 
+    if (messageID.is<CoreIPC::MessageClassWebNotificationManagerProxy>()) {
+        m_context->notificationManagerProxy()->didReceiveSyncMessage(connection, messageID, arguments, reply);
+        return;
+    }
+
     uint64_t pageID = arguments->destinationID();
     if (!pageID)
         return;
index f1370af..40384f8 100644 (file)
@@ -29,6 +29,7 @@
 #include "ImmutableDictionary.h"
 #include "NativeWebKeyboardEvent.h"
 #include "NativeWebWheelEvent.h"
+#include "NotificationPermissionRequest.h"
 #include "WKAPICast.h"
 #include "WebNumber.h"
 #include "WebOpenPanelResultListenerProxy.h"
@@ -331,6 +332,15 @@ bool WebUIClient::decidePolicyForGeolocationPermissionRequest(WebPageProxy* page
     return true;
 }
 
+bool WebUIClient::decidePolicyForNotificationPermissionRequest(WebPageProxy* page, WebSecurityOrigin* origin, NotificationPermissionRequest* permissionRequest)
+{
+    if (!m_client.decidePolicyForNotificationPermissionRequest)
+        return false;
+    
+    m_client.decidePolicyForNotificationPermissionRequest(toAPI(page), toAPI(origin), toAPI(permissionRequest), m_client.clientInfo);
+    return true;
+}
+
 float WebUIClient::headerHeight(WebPageProxy* page, WebFrameProxy* frame)
 {
     if (!m_client.headerHeight)
index 56e0988..835e6ce 100644 (file)
@@ -47,6 +47,7 @@ class APIObject;
 class GeolocationPermissionRequestProxy;
 class NativeWebKeyboardEvent;
 class NativeWebWheelEvent;
+class NotificationPermissionRequest;
 class WebData;
 class WebFrameProxy;
 class WebPageProxy;
@@ -99,6 +100,7 @@ public:
 
     bool runOpenPanel(WebPageProxy*, WebFrameProxy*, WebOpenPanelParameters*, WebOpenPanelResultListenerProxy*);
     bool decidePolicyForGeolocationPermissionRequest(WebPageProxy*, WebFrameProxy*, WebSecurityOrigin*, GeolocationPermissionRequestProxy*);
+    bool decidePolicyForNotificationPermissionRequest(WebPageProxy*, WebSecurityOrigin*, NotificationPermissionRequest*);
 
     // Printing.
     float headerHeight(WebPageProxy*, WebFrameProxy*);
index 4daeea1..045d8af 100644 (file)
                1CA8B954127C891500576C2B /* WebInspectorMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1C8E2DAD1278C5B200BC7BD0 /* WebInspectorMac.mm */; };
                29CD55AA128E294F00133C85 /* WKAccessibilityWebPageObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 29CD55A8128E294F00133C85 /* WKAccessibilityWebPageObject.h */; };
                29CD55AB128E294F00133C85 /* WKAccessibilityWebPageObject.mm in Sources */ = {isa = PBXBuildFile; fileRef = 29CD55A9128E294F00133C85 /* WKAccessibilityWebPageObject.mm */; };
-               3109996F146C741D0029DEB9 /* WebNotificationManagerProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = 3109996A146C73920029DEB9 /* WebNotificationManagerProxy.h */; };
-               31099970146C74200029DEB9 /* WebNotificationManagerProxy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3109996B146C73B10029DEB9 /* WebNotificationManagerProxy.cpp */; };
                31099973146C75A20029DEB9 /* WebNotificationClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 31099971146C759B0029DEB9 /* WebNotificationClient.cpp */; };
-               3109997A146C8B140029DEB9 /* WebNotificationManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 31099978146C8B140029DEB9 /* WebNotificationManager.cpp */; };
-               3109997B146C8B140029DEB9 /* WebNotificationManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 31099979146C8B140029DEB9 /* WebNotificationManager.h */; };
                310999C7146C9E3D0029DEB9 /* WebNotificationClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 31099968146C71F50029DEB9 /* WebNotificationClient.h */; };
-               312C0C47146DDBBD0016C911 /* WebNotificationProvider.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 312C0C46146DDBBC0016C911 /* WebNotificationProvider.cpp */; };
                312C0C4A146DDC8A0016C911 /* WKNotificationProvider.h in Headers */ = {isa = PBXBuildFile; fileRef = 312C0C49146DDC8A0016C911 /* WKNotificationProvider.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               3131261E148FF82C00BA2A39 /* NotificationPermissionRequestManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 31312619148FF82B00BA2A39 /* NotificationPermissionRequestManager.cpp */; };
+               3131261F148FF82C00BA2A39 /* NotificationPermissionRequestManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 3131261A148FF82B00BA2A39 /* NotificationPermissionRequestManager.h */; };
+               31312620148FF82C00BA2A39 /* WebNotificationManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3131261B148FF82B00BA2A39 /* WebNotificationManager.cpp */; };
+               31312621148FF82C00BA2A39 /* WebNotificationManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 3131261C148FF82B00BA2A39 /* WebNotificationManager.h */; };
                318BE1671473433700A8FBB2 /* WebNotificationManagerProxyMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 318BE1651473433700A8FBB2 /* WebNotificationManagerProxyMessageReceiver.cpp */; };
                318BE1681473433700A8FBB2 /* WebNotificationManagerProxyMessages.h in Headers */ = {isa = PBXBuildFile; fileRef = 318BE1661473433700A8FBB2 /* WebNotificationManagerProxyMessages.h */; };
                318BE17114743DB100A8FBB2 /* WKNotificationManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 318BE17014743DB100A8FBB2 /* WKNotificationManager.h */; settings = {ATTRIBUTES = (Private, ); }; };
                318BE17514743DD700A8FBB2 /* WKNotificationManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 318BE17414743DD600A8FBB2 /* WKNotificationManager.cpp */; };
                318BE17714743E6000A8FBB2 /* WKNotification.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 318BE17614743E6000A8FBB2 /* WKNotification.cpp */; };
                318BE17914743E6F00A8FBB2 /* WKNotification.h in Headers */ = {isa = PBXBuildFile; fileRef = 318BE17814743E6A00A8FBB2 /* WKNotification.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               31A2EC48148997C200810D71 /* WebNotification.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 31A2EC41148997BE00810D71 /* WebNotification.cpp */; };
+               31A2EC49148997C200810D71 /* WebNotification.h in Headers */ = {isa = PBXBuildFile; fileRef = 31A2EC42148997BE00810D71 /* WebNotification.h */; };
+               31A2EC4A148997C200810D71 /* WebNotificationManagerProxy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 31A2EC43148997BE00810D71 /* WebNotificationManagerProxy.cpp */; };
+               31A2EC4B148997C200810D71 /* WebNotificationManagerProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = 31A2EC44148997BF00810D71 /* WebNotificationManagerProxy.h */; };
+               31A2EC4D148997C200810D71 /* WebNotificationProvider.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 31A2EC46148997C000810D71 /* WebNotificationProvider.cpp */; };
+               31A2EC4E148997C200810D71 /* WebNotificationProvider.h in Headers */ = {isa = PBXBuildFile; fileRef = 31A2EC47148997C100810D71 /* WebNotificationProvider.h */; };
+               31A2EC501489980500810D71 /* NotificationPermissionRequestManagerProxy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 31A2EC4F1489980500810D71 /* NotificationPermissionRequestManagerProxy.cpp */; };
+               31A2EC521489981900810D71 /* NotificationPermissionRequestManagerProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = 31A2EC511489981500810D71 /* NotificationPermissionRequestManagerProxy.h */; };
+               31A2EC551489982E00810D71 /* NotificationPermissionRequest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 31A2EC541489982E00810D71 /* NotificationPermissionRequest.cpp */; };
+               31A2EC5614899C0900810D71 /* NotificationPermissionRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = 31A2EC531489982500810D71 /* NotificationPermissionRequest.h */; };
+               31A2EC74148D59CA00810D71 /* WKNotificationPermissionRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = 31A2EC72148D59BB00810D71 /* WKNotificationPermissionRequest.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               31A2EC77148D662E00810D71 /* WKNotificationPermissionRequest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 31A2EC75148D65BB00810D71 /* WKNotificationPermissionRequest.cpp */; };
                31BA924D148831260062EDB5 /* WebNotificationManagerMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 31BA9248148830810062EDB5 /* WebNotificationManagerMessageReceiver.cpp */; };
                31BA924E148831260062EDB5 /* WebNotificationManagerMessages.h in Headers */ = {isa = PBXBuildFile; fileRef = 31BA9249148830810062EDB5 /* WebNotificationManagerMessages.h */; };
-               31C11AB3148452E90049A4CC /* WebNotification.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 31C11AB1148452E90049A4CC /* WebNotification.cpp */; };
-               31C11AB4148452E90049A4CC /* WebNotification.h in Headers */ = {isa = PBXBuildFile; fileRef = 31C11AB2148452E90049A4CC /* WebNotification.h */; };
                31EA25D2134F78C0005B1452 /* NativeWebMouseEventMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 31EA25D0134F78B2005B1452 /* NativeWebMouseEventMac.mm */; };
                330934471315B9220097A7BC /* WebCookieManagerMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 330934431315B9220097A7BC /* WebCookieManagerMessageReceiver.cpp */; };
                330934481315B9220097A7BC /* WebCookieManagerMessages.h in Headers */ = {isa = PBXBuildFile; fileRef = 330934441315B9220097A7BC /* WebCookieManagerMessages.h */; };
                29CD55A8128E294F00133C85 /* WKAccessibilityWebPageObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKAccessibilityWebPageObject.h; sourceTree = "<group>"; };
                29CD55A9128E294F00133C85 /* WKAccessibilityWebPageObject.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WKAccessibilityWebPageObject.mm; sourceTree = "<group>"; };
                31099968146C71F50029DEB9 /* WebNotificationClient.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WebNotificationClient.h; sourceTree = "<group>"; };
-               3109996A146C73920029DEB9 /* WebNotificationManagerProxy.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WebNotificationManagerProxy.h; sourceTree = "<group>"; };
-               3109996B146C73B10029DEB9 /* WebNotificationManagerProxy.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebNotificationManagerProxy.cpp; sourceTree = "<group>"; };
-               3109996D146C73C40029DEB9 /* WebNotificationManagerProxy.messages.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = WebNotificationManagerProxy.messages.in; sourceTree = "<group>"; };
                31099971146C759B0029DEB9 /* WebNotificationClient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebNotificationClient.cpp; sourceTree = "<group>"; };
-               31099978146C8B140029DEB9 /* WebNotificationManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WebNotificationManager.cpp; path = Notifications/WebNotificationManager.cpp; sourceTree = "<group>"; };
-               31099979146C8B140029DEB9 /* WebNotificationManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebNotificationManager.h; path = Notifications/WebNotificationManager.h; sourceTree = "<group>"; };
-               312C0C46146DDBBC0016C911 /* WebNotificationProvider.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebNotificationProvider.cpp; sourceTree = "<group>"; };
-               312C0C48146DDBD30016C911 /* WebNotificationProvider.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WebNotificationProvider.h; sourceTree = "<group>"; };
                312C0C49146DDC8A0016C911 /* WKNotificationProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKNotificationProvider.h; sourceTree = "<group>"; };
+               31312619148FF82B00BA2A39 /* NotificationPermissionRequestManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NotificationPermissionRequestManager.cpp; sourceTree = "<group>"; };
+               3131261A148FF82B00BA2A39 /* NotificationPermissionRequestManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NotificationPermissionRequestManager.h; sourceTree = "<group>"; };
+               3131261B148FF82B00BA2A39 /* WebNotificationManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebNotificationManager.cpp; sourceTree = "<group>"; };
+               3131261C148FF82B00BA2A39 /* WebNotificationManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebNotificationManager.h; sourceTree = "<group>"; };
+               3131261D148FF82C00BA2A39 /* WebNotificationManager.messages.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = WebNotificationManager.messages.in; sourceTree = "<group>"; };
                318BE1651473433700A8FBB2 /* WebNotificationManagerProxyMessageReceiver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebNotificationManagerProxyMessageReceiver.cpp; sourceTree = "<group>"; };
                318BE1661473433700A8FBB2 /* WebNotificationManagerProxyMessages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebNotificationManagerProxyMessages.h; sourceTree = "<group>"; };
                318BE17014743DB100A8FBB2 /* WKNotificationManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKNotificationManager.h; sourceTree = "<group>"; };
                318BE17414743DD600A8FBB2 /* WKNotificationManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKNotificationManager.cpp; sourceTree = "<group>"; };
                318BE17614743E6000A8FBB2 /* WKNotification.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKNotification.cpp; sourceTree = "<group>"; };
                318BE17814743E6A00A8FBB2 /* WKNotification.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WKNotification.h; sourceTree = "<group>"; };
+               31A2EC41148997BE00810D71 /* WebNotification.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebNotification.cpp; sourceTree = "<group>"; };
+               31A2EC42148997BE00810D71 /* WebNotification.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebNotification.h; sourceTree = "<group>"; };
+               31A2EC43148997BE00810D71 /* WebNotificationManagerProxy.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebNotificationManagerProxy.cpp; sourceTree = "<group>"; };
+               31A2EC44148997BF00810D71 /* WebNotificationManagerProxy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebNotificationManagerProxy.h; sourceTree = "<group>"; };
+               31A2EC45148997BF00810D71 /* WebNotificationManagerProxy.messages.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = WebNotificationManagerProxy.messages.in; sourceTree = "<group>"; };
+               31A2EC46148997C000810D71 /* WebNotificationProvider.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebNotificationProvider.cpp; sourceTree = "<group>"; };
+               31A2EC47148997C100810D71 /* WebNotificationProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebNotificationProvider.h; sourceTree = "<group>"; };
+               31A2EC4F1489980500810D71 /* NotificationPermissionRequestManagerProxy.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NotificationPermissionRequestManagerProxy.cpp; sourceTree = "<group>"; };
+               31A2EC511489981500810D71 /* NotificationPermissionRequestManagerProxy.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NotificationPermissionRequestManagerProxy.h; sourceTree = "<group>"; };
+               31A2EC531489982500810D71 /* NotificationPermissionRequest.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NotificationPermissionRequest.h; sourceTree = "<group>"; };
+               31A2EC541489982E00810D71 /* NotificationPermissionRequest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NotificationPermissionRequest.cpp; sourceTree = "<group>"; };
+               31A2EC72148D59BB00810D71 /* WKNotificationPermissionRequest.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WKNotificationPermissionRequest.h; sourceTree = "<group>"; };
+               31A2EC75148D65BB00810D71 /* WKNotificationPermissionRequest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKNotificationPermissionRequest.cpp; sourceTree = "<group>"; };
                31BA9248148830810062EDB5 /* WebNotificationManagerMessageReceiver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebNotificationManagerMessageReceiver.cpp; sourceTree = "<group>"; };
                31BA9249148830810062EDB5 /* WebNotificationManagerMessages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebNotificationManagerMessages.h; sourceTree = "<group>"; };
-               31C11AB1148452E90049A4CC /* WebNotification.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebNotification.cpp; sourceTree = "<group>"; };
-               31C11AB2148452E90049A4CC /* WebNotification.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebNotification.h; sourceTree = "<group>"; };
                31EA25D0134F78B2005B1452 /* NativeWebMouseEventMac.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = NativeWebMouseEventMac.mm; sourceTree = "<group>"; };
                31EA25D3134F78D6005B1452 /* NativeWebMouseEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeWebMouseEvent.h; sourceTree = "<group>"; };
                32DBCF5E0370ADEE00C91783 /* WebKit2Prefix.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebKit2Prefix.h; sourceTree = "<group>"; };
                31099974146C8AA80029DEB9 /* Notifications (User) */ = {
                        isa = PBXGroup;
                        children = (
-                               31099978146C8B140029DEB9 /* WebNotificationManager.cpp */,
-                               31099979146C8B140029DEB9 /* WebNotificationManager.h */,
+                               31312619148FF82B00BA2A39 /* NotificationPermissionRequestManager.cpp */,
+                               3131261A148FF82B00BA2A39 /* NotificationPermissionRequestManager.h */,
+                               3131261B148FF82B00BA2A39 /* WebNotificationManager.cpp */,
+                               3131261C148FF82B00BA2A39 /* WebNotificationManager.h */,
+                               3131261D148FF82C00BA2A39 /* WebNotificationManager.messages.in */,
                        );
                        name = "Notifications (User)";
+                       path = Notifications;
+                       sourceTree = "<group>";
+               };
+               31A2EC401489973700810D71 /* Notifications */ = {
+                       isa = PBXGroup;
+                       children = (
+                               31A2EC4F1489980500810D71 /* NotificationPermissionRequestManagerProxy.cpp */,
+                               31A2EC511489981500810D71 /* NotificationPermissionRequestManagerProxy.h */,
+                               31A2EC541489982E00810D71 /* NotificationPermissionRequest.cpp */,
+                               31A2EC531489982500810D71 /* NotificationPermissionRequest.h */,
+                               31A2EC41148997BE00810D71 /* WebNotification.cpp */,
+                               31A2EC42148997BE00810D71 /* WebNotification.h */,
+                               31A2EC43148997BE00810D71 /* WebNotificationManagerProxy.cpp */,
+                               31A2EC44148997BF00810D71 /* WebNotificationManagerProxy.h */,
+                               31A2EC45148997BF00810D71 /* WebNotificationManagerProxy.messages.in */,
+                               31A2EC46148997C000810D71 /* WebNotificationProvider.cpp */,
+                               31A2EC47148997C100810D71 /* WebNotificationProvider.h */,
+                       );
+                       path = Notifications;
                        sourceTree = "<group>";
                };
                32C88DFF0371C24200C91783 /* Other Sources */ = {
                                1AB7D4C71288AA9A00CFD08C /* Downloads */,
                                BC111B18112F5FB400337BAB /* Launcher */,
                                BCCF085C113F3B7500C650C5 /* mac */,
+                               31A2EC401489973700810D71 /* Notifications */,
                                1AEFCC0511D01F34008219D3 /* Plugins */,
                                1A64256712DE42EC00CAAE2C /* BackingStore.cpp */,
                                1A64256612DE42EC00CAAE2C /* BackingStore.h */,
                                33D3A3B91339606200709BE4 /* WebMediaCacheManagerProxy.messages.in */,
                                BCF69FA11176D01400471A52 /* WebNavigationData.cpp */,
                                BCF69FA01176D01400471A52 /* WebNavigationData.h */,
-                               31C11AB1148452E90049A4CC /* WebNotification.cpp */,
-                               31C11AB2148452E90049A4CC /* WebNotification.h */,
-                               3109996B146C73B10029DEB9 /* WebNotificationManagerProxy.cpp */,
-                               3109996A146C73920029DEB9 /* WebNotificationManagerProxy.h */,
-                               3109996D146C73C40029DEB9 /* WebNotificationManagerProxy.messages.in */,
-                               312C0C46146DDBBC0016C911 /* WebNotificationProvider.cpp */,
-                               312C0C48146DDBD30016C911 /* WebNotificationProvider.h */,
                                BC1DFEA312B31F87005DF730 /* WebOpenPanelResultListenerProxy.cpp */,
                                BC1DFEA212B31F87005DF730 /* WebOpenPanelResultListenerProxy.h */,
                                5153569A1291B1D2000749DC /* WebPageContextMenuClient.cpp */,
                                518ACAE912AEE6BB00B04B83 /* WKProtectionSpaceTypes.h */,
                                33367638130C99DC006C9DE2 /* WKResourceCacheManager.cpp */,
                                33367639130C99DC006C9DE2 /* WKResourceCacheManager.h */,
+                               31A2EC72148D59BB00810D71 /* WKNotificationPermissionRequest.h */,
+                               31A2EC75148D65BB00810D71 /* WKNotificationPermissionRequest.cpp */,
                        );
                        path = C;
                        sourceTree = "<group>";
                                BC09B8F9147460F7005F5625 /* WebContextConnectionClient.h in Headers */,
                                3788A05C14743C90006319E5 /* WKBrowsingContextControllerPrivate.h in Headers */,
                                BCE9C0B71484714700E33D61 /* WebConnectionMessageKinds.h in Headers */,
-                               3109996F146C741D0029DEB9 /* WebNotificationManagerProxy.h in Headers */,
-                               3109997B146C8B140029DEB9 /* WebNotificationManager.h in Headers */,
                                310999C7146C9E3D0029DEB9 /* WebNotificationClient.h in Headers */,
                                312C0C4A146DDC8A0016C911 /* WKNotificationProvider.h in Headers */,
                                318BE1681473433700A8FBB2 /* WebNotificationManagerProxyMessages.h in Headers */,
                                318BE17114743DB100A8FBB2 /* WKNotificationManager.h in Headers */,
                                318BE17914743E6F00A8FBB2 /* WKNotification.h in Headers */,
-                               31C11AB4148452E90049A4CC /* WebNotification.h in Headers */,
                                31BA924E148831260062EDB5 /* WebNotificationManagerMessages.h in Headers */,
+                               31A2EC49148997C200810D71 /* WebNotification.h in Headers */,
+                               31A2EC4B148997C200810D71 /* WebNotificationManagerProxy.h in Headers */,
+                               31A2EC4E148997C200810D71 /* WebNotificationProvider.h in Headers */,
+                               31A2EC521489981900810D71 /* NotificationPermissionRequestManagerProxy.h in Headers */,
+                               31A2EC5614899C0900810D71 /* NotificationPermissionRequest.h in Headers */,
+                               31A2EC74148D59CA00810D71 /* WKNotificationPermissionRequest.h in Headers */,
+                               3131261F148FF82C00BA2A39 /* NotificationPermissionRequestManager.h in Headers */,
+                               31312621148FF82C00BA2A39 /* WebNotificationManager.h in Headers */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
                                BC4A6296147313A0006C681A /* WKConnectionRef.cpp in Sources */,
                                BC4A62A714744EC7006C681A /* WebConnectionToWebProcess.cpp in Sources */,
                                BC09B8F8147460F7005F5625 /* WebContextConnectionClient.cpp in Sources */,
-                               31099970146C74200029DEB9 /* WebNotificationManagerProxy.cpp in Sources */,
                                31099973146C75A20029DEB9 /* WebNotificationClient.cpp in Sources */,
-                               3109997A146C8B140029DEB9 /* WebNotificationManager.cpp in Sources */,
-                               312C0C47146DDBBD0016C911 /* WebNotificationProvider.cpp in Sources */,
                                318BE1671473433700A8FBB2 /* WebNotificationManagerProxyMessageReceiver.cpp in Sources */,
                                318BE17514743DD700A8FBB2 /* WKNotificationManager.cpp in Sources */,
                                318BE17714743E6000A8FBB2 /* WKNotification.cpp in Sources */,
-                               31C11AB3148452E90049A4CC /* WebNotification.cpp in Sources */,
                                31BA924D148831260062EDB5 /* WebNotificationManagerMessageReceiver.cpp in Sources */,
                                BCD3675C148C26C000447E87 /* WebConnectionToUIProcess.cpp in Sources */,
                                8CFECE941490F140002AAA32 /* EditorState.cpp in Sources */,
                                B63403F914910D57001070B5 /* APIObject.cpp in Sources */,
+                               31A2EC48148997C200810D71 /* WebNotification.cpp in Sources */,
+                               31A2EC4A148997C200810D71 /* WebNotificationManagerProxy.cpp in Sources */,
+                               31A2EC4D148997C200810D71 /* WebNotificationProvider.cpp in Sources */,
+                               31A2EC501489980500810D71 /* NotificationPermissionRequestManagerProxy.cpp in Sources */,
+                               31A2EC551489982E00810D71 /* NotificationPermissionRequest.cpp in Sources */,
+                               31A2EC77148D662E00810D71 /* WKNotificationPermissionRequest.cpp in Sources */,
+                               3131261E148FF82C00BA2A39 /* NotificationPermissionRequestManager.cpp in Sources */,
+                               31312620148FF82C00BA2A39 /* WebNotificationManager.cpp in Sources */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
diff --git a/Source/WebKit2/WebProcess/Notifications/NotificationPermissionRequestManager.cpp b/Source/WebKit2/WebProcess/Notifications/NotificationPermissionRequestManager.cpp
new file mode 100644 (file)
index 0000000..3eeaa50
--- /dev/null
@@ -0,0 +1,119 @@
+/*
+ * Copyright (C) 2011 Apple Inc. All rights reserved.
+ *
+ * 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 "NotificationPermissionRequestManager.h"
+
+#include "WebCoreArgumentCoders.h"
+#include "WebNotificationManagerProxyMessages.h"
+#include "WebPage.h"
+#include "WebPageProxyMessages.h"
+#include "WebProcess.h"
+#include <WebCore/Notification.h>
+#include <WebCore/ScriptExecutionContext.h>
+#include <WebCore/SecurityOrigin.h>
+
+using namespace WebCore;
+
+namespace WebKit {
+
+#if ENABLE(NOTIFICATIONS)
+static uint64_t generateRequestID()
+{
+    static uint64_t uniqueRequestID = 1;
+    return uniqueRequestID++;
+}
+#endif
+
+PassRefPtr<NotificationPermissionRequestManager> NotificationPermissionRequestManager::create(WebPage* page)
+{
+    return adoptRef(new NotificationPermissionRequestManager(page));
+}
+
+NotificationPermissionRequestManager::NotificationPermissionRequestManager(WebPage* page)
+    : m_page(page)
+{
+}
+
+void NotificationPermissionRequestManager::startRequest(SecurityOrigin* origin, PassRefPtr<VoidCallback> callback)
+{
+#if ENABLE(NOTIFICATIONS)
+    uint64_t requestID = generateRequestID();
+    m_originToIDMap.set(origin, requestID);
+    m_idToOriginMap.set(requestID, origin);
+    m_idToCallbackMap.set(requestID, callback);
+    m_page->send(Messages::WebPageProxy::RequestNotificationPermission(requestID, origin->databaseIdentifier()));
+#else
+    UNUSED_PARAM(origin);
+    UNUSED_PARAM(callback);
+#endif
+}
+
+void NotificationPermissionRequestManager::cancelRequest(SecurityOrigin* origin)
+{
+#if ENABLE(NOTIFICATIONS)
+    uint64_t id = m_originToIDMap.take(origin);
+    if (!id)
+        return;
+    
+    m_idToOriginMap.remove(id);
+    m_idToCallbackMap.remove(id);
+#else
+    UNUSED_PARAM(origin);
+#endif
+}
+
+NotificationPresenter::Permission NotificationPermissionRequestManager::permissionLevel(SecurityOrigin* securityOrigin)
+{
+#if ENABLE(NOTIFICATIONS)
+    uint64_t permissionLevel;
+    WebProcess::shared().connection()->sendSync(Messages::WebNotificationManagerProxy::NotificationPermissionLevel(securityOrigin->databaseIdentifier()),
+                                                Messages::WebNotificationManagerProxy::NotificationPermissionLevel::Reply(permissionLevel),
+                                                0);
+    return static_cast<NotificationPresenter::Permission>(permissionLevel);
+#else
+    UNUSED_PARAM(securityOrigin);
+    return NotificationPresenter::PermissionDenied;
+#endif
+}
+
+void NotificationPermissionRequestManager::didReceiveNotificationPermissionDecision(uint64_t requestID, bool allowed)
+{
+#if ENABLE(NOTIFICATIONS)
+    if (!isRequestIDValid(requestID))
+        return;
+
+    RefPtr<VoidCallback> callback = m_idToCallbackMap.take(requestID);
+    if (!callback)
+        return;
+    
+    callback->handleEvent();
+#else
+    UNUSED_PARAM(requestID);
+    UNUSED_PARAM(allowed);
+#endif    
+}
+
+} // namespace WebKit
diff --git a/Source/WebKit2/WebProcess/Notifications/NotificationPermissionRequestManager.h b/Source/WebKit2/WebProcess/Notifications/NotificationPermissionRequestManager.h
new file mode 100644 (file)
index 0000000..5573c6a
--- /dev/null
@@ -0,0 +1,76 @@
+/*
+ * Copyright (C) 2011 Apple Inc. All rights reserved.
+ *
+ * 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.
+ */
+
+#ifndef NotificationPermissionRequestManager_h
+#define NotificationPermissionRequestManager_h
+
+#include <WebCore/NotificationPresenter.h>
+#include <WebCore/VoidCallback.h>
+#include <wtf/HashMap.h>
+#include <wtf/RefCounted.h>
+#include <wtf/RefPtr.h>
+
+namespace WebCore {
+class Notification;    
+class SecurityOrigin;
+}
+
+namespace WebKit {
+
+class WebPage;
+
+/// FIXME: Need to keep a queue of pending notifications which permission is still being requested.
+class NotificationPermissionRequestManager : public RefCounted<NotificationPermissionRequestManager> {
+public:
+    static PassRefPtr<NotificationPermissionRequestManager> create(WebPage*);
+    
+    void startRequest(WebCore::SecurityOrigin*, PassRefPtr<WebCore::VoidCallback>);
+    void cancelRequest(WebCore::SecurityOrigin*);
+    
+    // Synchronous call to retrieve permission level for given security origin
+    WebCore::NotificationPresenter::Permission permissionLevel(WebCore::SecurityOrigin*);
+    
+    void didReceiveNotificationPermissionDecision(uint64_t notificationID, bool allowed);
+    
+private:
+    NotificationPermissionRequestManager(WebPage*);
+    
+    HashMap<uint64_t, RefPtr<WebCore::VoidCallback> > m_idToCallbackMap;
+    HashMap<RefPtr<WebCore::SecurityOrigin>, uint64_t> m_originToIDMap;
+    HashMap<uint64_t, RefPtr<WebCore::SecurityOrigin> > m_idToOriginMap;
+
+    WebPage* m_page;
+};
+
+inline bool isRequestIDValid(uint64_t id)
+{
+    // This check makes sure that the ID is not equal to values needed by
+    // HashMap for bucketing.
+    return id && id != static_cast<uint64_t>(-1);
+}
+
+} // namespace WebKit
+
+#endif // NotificationPermissionRequestManager_h
index 07cfafc..3b32f0a 100644 (file)
@@ -38,7 +38,7 @@ class Connection;
 }
 
 namespace WebCore {
-class Notification;    
+class Notification;
 }
 
 namespace WebKit {
index f1848bd..e06234a 100644 (file)
 
 #if ENABLE(NOTIFICATIONS)
 
+#include "NotificationPermissionRequestManager.h"
 #include "WebNotificationManager.h"
+#include "WebPage.h"
 #include "WebProcess.h"
 #include <WebCore/NotImplemented.h>
+#include <WebCore/ScriptExecutionContext.h>
 
 using namespace WebCore;
 
@@ -74,20 +77,21 @@ void WebNotificationClient::notificationObjectDestroyed(Notification* notificati
 #endif
 }
 
-void WebNotificationClient::requestPermission(ScriptExecutionContext*, PassRefPtr<VoidCallback>)
+void WebNotificationClient::requestPermission(ScriptExecutionContext* context, PassRefPtr<VoidCallback> callback)
 {
-    notImplemented();
+    m_page->notificationPermissionRequestManager()->startRequest(context->securityOrigin(), callback);
 }
 
-void WebNotificationClient::cancelRequestsForPermission(ScriptExecutionContext*)
+void WebNotificationClient::cancelRequestsForPermission(ScriptExecutionContext* context)
 {
-    notImplemented();
+    m_page->notificationPermissionRequestManager()->cancelRequest(context->securityOrigin());
 }
 
-NotificationPresenter::Permission WebNotificationClient::checkPermission(ScriptExecutionContext*)
+NotificationPresenter::Permission WebNotificationClient::checkPermission(ScriptExecutionContext* context)
 {
-    notImplemented();
-    return NotificationPresenter::PermissionDenied;
+    if (!context || !context->isDocument())
+        return NotificationPresenter::PermissionDenied;
+    return m_page->notificationPermissionRequestManager()->permissionLevel(context->securityOrigin());
 }
 
 } // namespace WebKit
index f2d8bcc..148fee7 100644 (file)
@@ -35,6 +35,7 @@
 #include "LayerTreeHost.h"
 #include "MessageID.h"
 #include "NetscapePlugin.h"
+#include "NotificationPermissionRequestManager.h"
 #include "PageOverlay.h"
 #include "PluginProxy.h"
 #include "PluginView.h"
@@ -1877,6 +1878,15 @@ WebFullScreenManager* WebPage::fullScreenManager()
 }
 #endif
 
+NotificationPermissionRequestManager* WebPage::notificationPermissionRequestManager()
+{
+    if (m_notificationPermissionRequestManager)
+        return m_notificationPermissionRequestManager.get();
+
+    m_notificationPermissionRequestManager = NotificationPermissionRequestManager::create(this);
+    return m_notificationPermissionRequestManager.get();
+}
+
 #if !PLATFORM(GTK) && !PLATFORM(MAC)
 bool WebPage::handleEditingKeyboardEvent(KeyboardEvent* evt)
 {
@@ -2153,6 +2163,11 @@ void WebPage::didReceiveGeolocationPermissionDecision(uint64_t geolocationID, bo
     m_geolocationPermissionRequestManager.didReceiveGeolocationPermissionDecision(geolocationID, allowed);
 }
 
+void WebPage::didReceiveNotificationPermissionDecision(uint64_t notificationID, bool allowed)
+{
+    notificationPermissionRequestManager()->didReceiveNotificationPermissionDecision(notificationID, allowed);
+}
+
 void WebPage::advanceToNextMisspelling(bool startBeforeSelection)
 {
     Frame* frame = m_page->focusController()->focusedOrMainFrame();
index 916d862..8756b41 100644 (file)
@@ -102,6 +102,7 @@ namespace WebKit {
 
 class DrawingArea;
 class InjectedBundleBackForwardList;
+class NotificationPermissionRequestManager;
 class PageOverlay;
 class PluginView;
 class SessionState;
@@ -309,6 +310,7 @@ public:
 
     FindController& findController() { return m_findController; }
     GeolocationPermissionRequestManager& geolocationPermissionRequestManager() { return m_geolocationPermissionRequestManager; }
+    NotificationPermissionRequestManager* notificationPermissionRequestManager();
 
     void pageDidScroll();
 #if USE(TILED_BACKING_STORE)
@@ -587,6 +589,7 @@ private:
 #endif
 
     void didReceiveGeolocationPermissionDecision(uint64_t geolocationID, bool allowed);
+    void didReceiveNotificationPermissionDecision(uint64_t notificationID, bool allowed);
 
     void advanceToNextMisspelling(bool startBeforeSelection);
     void changeSpellingToWord(const String& word);
@@ -693,6 +696,7 @@ private:
     RefPtr<WebContextMenu> m_contextMenu;
     RefPtr<WebOpenPanelResultListener> m_activeOpenPanelResultListener;
     GeolocationPermissionRequestManager m_geolocationPermissionRequestManager;
+    RefPtr<NotificationPermissionRequestManager> m_notificationPermissionRequestManager;
 
     OwnPtr<WebCore::PrintContext> m_printContext;
 
index d0e304b..3786191 100644 (file)
@@ -172,6 +172,9 @@ messages -> WebPage {
 
     # Geolocation
     DidReceiveGeolocationPermissionDecision(uint64_t geolocationID, bool allowed)
+    
+    # Notification
+    DidReceiveNotificationPermissionDecision(uint64_t notificationID, bool allowed)
 
     SetWindowResizerSize(WebCore::IntSize intersectsView)
 
index 0b7daa5..f03f11e 100755 (executable)
                        Name="WebProcess"
                        >
                        <File
-                               RelativePath="..\WebProcess\WebKitMain.cpp"
+                               RelativePath="..\WebProcess\WebConnectionToUIProcess.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\WebProcess\WebConnectionToUIProcess.cpp"
+                               RelativePath="..\WebProcess\WebConnectionToUIProcess.h"
                                >
                        </File>
                        <File
-                               RelativePath="..\WebProcess\WebConnectionToUIProcess.h"
+                               RelativePath="..\WebProcess\WebKitMain.cpp"
                                >
                        </File>
                        <File
                                Name="Notifications (User)"
                                >
                                <File
+                                       RelativePath="..\WebProcess\Notifications\NotificationPermissionRequestManager.cpp"
+                                       >
+                               </File>
+                               <File
+                                       RelativePath="..\WebProcess\Notifications\NotificationPermissionRequestManager.h"
+                                       >
+                               </File>
+                               <File
                                        RelativePath="..\WebProcess\Notifications\WebNotificationManager.cpp"
                                        >
                                </File>
                                >
                        </File>
                        <File
-                               RelativePath="..\UIProcess\WebNotification.cpp"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\UIProcess\WebNotification.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\UIProcess\WebNotificationManagerProxy.cpp"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\UIProcess\WebNotificationManagerProxy.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\UIProcess\WebNotificationManagerProxy.messages.in"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\UIProcess\WebNotificationProvider.cpp"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\UIProcess\WebNotificationProvider.h"
-                               >
-                       </File>
-                       <File
                                RelativePath="..\UIProcess\WebOpenPanelResultListenerProxy.cpp"
                                >
                        </File>
                                        </File>
                                </Filter>
                        </Filter>
+                       <Filter
+                               Name="Notifications (User)"
+                               >
+                               <File
+                                       RelativePath="..\UIProcess\Notifications\NotificationPermissionRequest.cpp"
+                                       >
+                               </File>
+                               <File
+                                       RelativePath="..\UIProcess\Notifications\NotificationPermissionRequest.h"
+                                       >
+                               </File>
+                               <File
+                                       RelativePath="..\UIProcess\Notifications\NotificationPermissionRequestManagerProxy.cpp"
+                                       >
+                               </File>
+                               <File
+                                       RelativePath="..\UIProcess\Notifications\NotificationPermissionRequestManagerProxy.h"
+                                       >
+                               </File>
+                               <File
+                                       RelativePath="..\UIProcess\Notifications\WebNotification.cpp"
+                                       >
+                               </File>
+                               <File
+                                       RelativePath="..\UIProcess\Notifications\WebNotification.h"
+                                       >
+                               </File>
+                               <File
+                                       RelativePath="..\UIProcess\Notifications\WebNotificationManagerProxy.cpp"
+                                       >
+                               </File>
+                               <File
+                                       RelativePath="..\UIProcess\Notifications\WebNotificationManagerProxy.h"
+                                       >
+                               </File>
+                               <File
+                                       RelativePath="..\UIProcess\Notifications\WebNotificationManagerProxy.messages.in"
+                                       >
+                               </File>
+                               <File
+                                       RelativePath="..\UIProcess\Notifications\WebNotificationProvider.cpp"
+                                       >
+                               </File>
+                               <File
+                                       RelativePath="..\UIProcess\Notifications\WebNotificationProvider.h"
+                                       >
+                               </File>
+                       </Filter>
                </Filter>
                <Filter
                        Name="Platform"
index cc14afd..81d34d9 100755 (executable)
@@ -6,7 +6,7 @@
        >
        <Tool
                Name="VCCLCompilerTool"
-               AdditionalIncludeDirectories="&quot;$(ProjectDir)&quot;;&quot;$(ProjectDir)\..&quot;;&quot;$(ProjectDir)\..\Platform&quot;;&quot;$(ProjectDir)\..\Platform\cg&quot;;&quot;$(ProjectDir)\..\Platform\CoreIPC&quot;;&quot;$(ProjectDir)\..\PluginProcess&quot;;&quot;$(ProjectDir)\..\Shared&quot;;&quot;$(ProjectDir)\..\Shared\win&quot;;&quot;$(ProjectDir)\..\Shared\cf&quot;;&quot;$(ProjectDir)\..\Shared\API\c&quot;;&quot;$(ProjectDir)\..\Shared\API\c\cf&quot;;&quot;$(ProjectDir)\..\Shared\API\c\win&quot;;&quot;$(ProjectDir)\..\Shared\CoreIPCSupport&quot;;&quot;$(ProjectDir)\..\Shared\Plugins&quot;;&quot;$(ProjectDir)\..\Shared\Plugins\Netscape&quot;;&quot;$(ProjectDir)\..\UIProcess&quot;;&quot;$(ProjectDir)\..\UIProcess\API\C&quot;;&quot;$(ProjectDir)\..\UIProcess\API\C\win&quot;;&quot;$(ProjectDir)\..\UIProcess\API\cpp&quot;;&quot;$(ProjectDir)\..\UIProcess\API\win&quot;;&quot;$(ProjectDir)\..\UIProcess\Authentication&quot;;&quot;$(ProjectDir)\..\UIProcess\Downloads&quot;;&quot;$(ProjectDir)\..\UIProcess\Launcher&quot;;&quot;$(ProjectDir)\..\UIProcess\Plugins&quot;;&quot;$(ProjectDir)\..\UIProcess\win&quot;;&quot;$(ProjectDir)\..\WebProcess&quot;;&quot;$(ProjectDir)\..\WebProcess\WebCoreSupport&quot;;&quot;$(ProjectDir)\..\WebProcess\WebCoreSupport\win&quot;;&quot;$(ProjectDir)\..\WebProcess\WebPage&quot;;&quot;$(ProjectDir)\..\WebProcess\WebPage\win&quot;;&quot;$(ProjectDir)\..\WebProcess\IconDatabase&quot;;&quot;$(ProjectDir)\..\WebProcess\InjectedBundle&quot;;&quot;$(ProjectDir)\..\WebProcess\InjectedBundle\API\c&quot;;&quot;$(ProjectDir)\..\WebProcess\InjectedBundle\DOM&quot;;&quot;$(ProjectDir)\..\WebProcess\InjectedBundle\win&quot;;&quot;$(ProjectDir)\..\WebProcess\Plugins&quot;;&quot;$(ProjectDir)\..\WebProcess\Plugins\Netscape&quot;;&quot;$(ProjectDir)\..\WebProcess\win&quot;;&quot;$(ProjectDir)\..\WebProcess\ApplicationCache&quot;;&quot;$(ProjectDir)\..\WebProcess\Authentication&quot;;&quot;$(ProjectDir)\..\WebProcess\Cookies&quot;;&quot;$(ProjectDir)\..\WebProcess\Cookies\cf&quot;;&quot;$(ProjectDir)\..\WebProcess\Downloads&quot;;&quot;$(ProjectDir)\..\WebProcess\Downloads\cf&quot;;&quot;$(ProjectDir)\..\WebProcess\FullScreen&quot;;&quot;$(ProjectDir)\..\WebProcess\Geolocation&quot;;&quot;$(ProjectDir)\..\WebProcess\KeyValueStorage&quot;;&quot;$(ProjectDir)\..\WebProcess\MediaCache&quot;;&quot;$(ProjectDir)\..\WebProcess\Notifications&quot;;&quot;$(ProjectDir)\..\WebProcess\ResourceCache&quot;;&quot;$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources&quot;;&quot;$(ConfigurationBuildDir)\Include&quot;;&quot;$(ConfigurationBuildDir)\Include\private&quot;;&quot;$(WebKitLibrariesDir)\Include&quot;;&quot;$(WebKitLibrariesDir)\Include\private&quot;;&quot;$(WebKitLibrariesDir)\Include\pthreads&quot;;&quot;$(ConfigurationBuildDir)\Include\JavaScriptCore&quot;;&quot;$(ConfigurationBuildDir)\Include\private\JavaScriptCore&quot;;&quot;$(WebKitLibrariesDir)\Include\JavaScriptCore&quot;;&quot;$(WebKitLibrariesDir)\Include\private\JavaScriptCore&quot;;&quot;$(ConfigurationBuildDir)\Include\WebCore\ForwardingHeaders&quot;;&quot;$(WebKitLibrariesDir)\Include\WebCore\ForwardingHeaders&quot;"
+               AdditionalIncludeDirectories="&quot;$(ProjectDir)&quot;;&quot;$(ProjectDir)\..&quot;;&quot;$(ProjectDir)\..\Platform&quot;;&quot;$(ProjectDir)\..\Platform\cg&quot;;&quot;$(ProjectDir)\..\Platform\CoreIPC&quot;;&quot;$(ProjectDir)\..\PluginProcess&quot;;&quot;$(ProjectDir)\..\Shared&quot;;&quot;$(ProjectDir)\..\Shared\win&quot;;&quot;$(ProjectDir)\..\Shared\cf&quot;;&quot;$(ProjectDir)\..\Shared\API\c&quot;;&quot;$(ProjectDir)\..\Shared\API\c\cf&quot;;&quot;$(ProjectDir)\..\Shared\API\c\win&quot;;&quot;$(ProjectDir)\..\Shared\CoreIPCSupport&quot;;&quot;$(ProjectDir)\..\Shared\Plugins&quot;;&quot;$(ProjectDir)\..\Shared\Plugins\Netscape&quot;;&quot;$(ProjectDir)\..\UIProcess&quot;;&quot;$(ProjectDir)\..\UIProcess\API\C&quot;;&quot;$(ProjectDir)\..\UIProcess\API\C\win&quot;;&quot;$(ProjectDir)\..\UIProcess\API\cpp&quot;;&quot;$(ProjectDir)\..\UIProcess\API\win&quot;;&quot;$(ProjectDir)\..\UIProcess\Authentication&quot;;&quot;$(ProjectDir)\..\UIProcess\Downloads&quot;;&quot;$(ProjectDir)\..\UIProcess\Launcher&quot;;&quot;$(ProjectDir)\..\UIProcess\Notifications&quot;;&quot;$(ProjectDir)\..\UIProcess\Plugins&quot;;&quot;$(ProjectDir)\..\UIProcess\win&quot;;&quot;$(ProjectDir)\..\WebProcess&quot;;&quot;$(ProjectDir)\..\WebProcess\WebCoreSupport&quot;;&quot;$(ProjectDir)\..\WebProcess\WebCoreSupport\win&quot;;&quot;$(ProjectDir)\..\WebProcess\WebPage&quot;;&quot;$(ProjectDir)\..\WebProcess\WebPage\win&quot;;&quot;$(ProjectDir)\..\WebProcess\IconDatabase&quot;;&quot;$(ProjectDir)\..\WebProcess\InjectedBundle&quot;;&quot;$(ProjectDir)\..\WebProcess\InjectedBundle\API\c&quot;;&quot;$(ProjectDir)\..\WebProcess\InjectedBundle\DOM&quot;;&quot;$(ProjectDir)\..\WebProcess\InjectedBundle\win&quot;;&quot;$(ProjectDir)\..\WebProcess\Plugins&quot;;&quot;$(ProjectDir)\..\WebProcess\Plugins\Netscape&quot;;&quot;$(ProjectDir)\..\WebProcess\win&quot;;&quot;$(ProjectDir)\..\WebProcess\ApplicationCache&quot;;&quot;$(ProjectDir)\..\WebProcess\Authentication&quot;;&quot;$(ProjectDir)\..\WebProcess\Cookies&quot;;&quot;$(ProjectDir)\..\WebProcess\Cookies\cf&quot;;&quot;$(ProjectDir)\..\WebProcess\Downloads&quot;;&quot;$(ProjectDir)\..\WebProcess\Downloads\cf&quot;;&quot;$(ProjectDir)\..\WebProcess\FullScreen&quot;;&quot;$(ProjectDir)\..\WebProcess\Geolocation&quot;;&quot;$(ProjectDir)\..\WebProcess\KeyValueStorage&quot;;&quot;$(ProjectDir)\..\WebProcess\MediaCache&quot;;&quot;$(ProjectDir)\..\WebProcess\Notifications&quot;;&quot;$(ProjectDir)\..\WebProcess\ResourceCache&quot;;&quot;$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources&quot;;&quot;$(ConfigurationBuildDir)\Include&quot;;&quot;$(ConfigurationBuildDir)\Include\private&quot;;&quot;$(WebKitLibrariesDir)\Include&quot;;&quot;$(WebKitLibrariesDir)\Include\private&quot;;&quot;$(WebKitLibrariesDir)\Include\pthreads&quot;;&quot;$(ConfigurationBuildDir)\Include\JavaScriptCore&quot;;&quot;$(ConfigurationBuildDir)\Include\private\JavaScriptCore&quot;;&quot;$(WebKitLibrariesDir)\Include\JavaScriptCore&quot;;&quot;$(WebKitLibrariesDir)\Include\private\JavaScriptCore&quot;;&quot;$(ConfigurationBuildDir)\Include\WebCore\ForwardingHeaders&quot;;&quot;$(WebKitLibrariesDir)\Include\WebCore\ForwardingHeaders&quot;"
                PreprocessorDefinitions="_USRDLL;WEBKIT_EXPORTS;FRAMEWORK_NAME=WebKit;BUILDING_WEBKIT"
                UsePrecompiledHeader="2"
                PrecompiledHeaderThrough="WebKit2Prefix.h"
index e21cfe3..362563b 100644 (file)
@@ -1,3 +1,19 @@
+2011-12-06  Jon Lee  <jonlee@apple.com>
+
+        [WK2] Add permissions support (73960)
+        https://bugs.webkit.org/show_bug.cgi?id=73960
+        <rdar://problem/10357008>
+
+        Reviewed by Darin Adler.
+
+        Add null function item to comply with added callback to WKPageUIClient.
+
+        * MiniBrowser/mac/BrowserWindowController.m:
+        (-[BrowserWindowController awakeFromNib]):
+        * WebKitTestRunner/TestController.cpp:
+        (WTR::TestController::createOtherPage):
+        (WTR::TestController::initialize):
+
 2011-12-08  Alexander Færøy  <alexander.faeroy@nokia.com>
 
         [Qt] Visualize mock points in the Qt MiniBrowser
index f7e9c69..4993aa9 100644 (file)
@@ -667,6 +667,7 @@ static void runOpenPanel(WKPageRef page, WKFrameRef frame, WKOpenPanelParameters
         0, // shouldInterruptJavaScript
         createNewPage,
         mouseDidMoveOverElement,
+        0, // decidePolicyForNotificationPermissionRequest
     };
     WKPageSetPageUIClient(_webView.pageRef, &uiClient);
 }
index cf71140..de68a29 100644 (file)
@@ -204,6 +204,7 @@ WKPageRef TestController::createOtherPage(WKPageRef oldPage, WKURLRequestRef, WK
         0, // shouldInterruptJavaScript
         createOtherPage,
         0, // mouseDidMoveOverElement
+        0, // decidePolicyForNotificationPermissionRequest
     };
     WKPageSetPageUIClient(newPage, &otherPageUIClient);
 
@@ -356,6 +357,7 @@ void TestController::initialize(int argc, const char* argv[])
         0, // shouldInterruptJavaScript
         createOtherPage,
         0, // mouseDidMoveOverElement
+        0, // decidePolicyForNotificationPermissionRequest
     };
     WKPageSetPageUIClient(m_mainWebView->page(), &pageUIClient);