Add API::PolicyClient base class
authorandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 23 Jan 2014 22:01:23 +0000 (22:01 +0000)
committerandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 23 Jan 2014 22:01:23 +0000 (22:01 +0000)
https://bugs.webkit.org/show_bug.cgi?id=127509

Reviewed by Tim Horton.

* UIProcess/API/APIPolicyClient.h: Copied from Source/WebKit2/UIProcess/WebPolicyClient.h.
(API::PolicyClient::~PolicyClient):
* UIProcess/API/C/WKPage.cpp:
(WKPageSetPagePolicyClient):
* UIProcess/API/Cocoa/WKBrowsingContextController.mm:
(setUpPagePolicyClient):
(-[WKBrowsingContextController setPolicyDelegate:]):
* UIProcess/WebInspectorProxy.cpp:
(WebKit::WebInspectorProxy::createInspectorPage):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::setPolicyClient):
(WebKit::WebPageProxy::close):
(WebKit::WebPageProxy::decidePolicyForNavigationAction):
(WebKit::WebPageProxy::decidePolicyForNewWindowAction):
(WebKit::WebPageProxy::decidePolicyForResponse):
(WebKit::WebPageProxy::unableToImplementPolicy):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPolicyClient.cpp:
(WebKit::WebPolicyClient::WebPolicyClient):
(WebKit::WebPolicyClient::decidePolicyForNavigationAction):
(WebKit::WebPolicyClient::decidePolicyForNewWindowAction):
(WebKit::WebPolicyClient::decidePolicyForResponse):
* UIProcess/WebPolicyClient.h:
* WebKit2.xcodeproj/project.pbxproj:

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

Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/API/APIPolicyClient.h [new file with mode: 0644]
Source/WebKit2/UIProcess/API/C/WKPage.cpp
Source/WebKit2/UIProcess/API/Cocoa/WKBrowsingContextController.mm
Source/WebKit2/UIProcess/WebInspectorProxy.cpp
Source/WebKit2/UIProcess/WebPageProxy.cpp
Source/WebKit2/UIProcess/WebPageProxy.h
Source/WebKit2/UIProcess/WebPolicyClient.cpp
Source/WebKit2/UIProcess/WebPolicyClient.h
Source/WebKit2/WebKit2.xcodeproj/project.pbxproj

index 3a2e462..69271a3 100644 (file)
@@ -1,5 +1,37 @@
 2014-01-23  Anders Carlsson  <andersca@apple.com>
 
+        Add API::PolicyClient base class
+        https://bugs.webkit.org/show_bug.cgi?id=127509
+
+        Reviewed by Tim Horton.
+
+        * UIProcess/API/APIPolicyClient.h: Copied from Source/WebKit2/UIProcess/WebPolicyClient.h.
+        (API::PolicyClient::~PolicyClient):
+        * UIProcess/API/C/WKPage.cpp:
+        (WKPageSetPagePolicyClient):
+        * UIProcess/API/Cocoa/WKBrowsingContextController.mm:
+        (setUpPagePolicyClient):
+        (-[WKBrowsingContextController setPolicyDelegate:]):
+        * UIProcess/WebInspectorProxy.cpp:
+        (WebKit::WebInspectorProxy::createInspectorPage):
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::setPolicyClient):
+        (WebKit::WebPageProxy::close):
+        (WebKit::WebPageProxy::decidePolicyForNavigationAction):
+        (WebKit::WebPageProxy::decidePolicyForNewWindowAction):
+        (WebKit::WebPageProxy::decidePolicyForResponse):
+        (WebKit::WebPageProxy::unableToImplementPolicy):
+        * UIProcess/WebPageProxy.h:
+        * UIProcess/WebPolicyClient.cpp:
+        (WebKit::WebPolicyClient::WebPolicyClient):
+        (WebKit::WebPolicyClient::decidePolicyForNavigationAction):
+        (WebKit::WebPolicyClient::decidePolicyForNewWindowAction):
+        (WebKit::WebPolicyClient::decidePolicyForResponse):
+        * UIProcess/WebPolicyClient.h:
+        * WebKit2.xcodeproj/project.pbxproj:
+
+2014-01-23  Anders Carlsson  <andersca@apple.com>
+
         Add init methods that create default configurations
         https://bugs.webkit.org/show_bug.cgi?id=127503
 
diff --git a/Source/WebKit2/UIProcess/API/APIPolicyClient.h b/Source/WebKit2/UIProcess/API/APIPolicyClient.h
new file mode 100644 (file)
index 0000000..3db0d49
--- /dev/null
@@ -0,0 +1,60 @@
+/*
+ * Copyright (C) 2014 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 APIPolicyClient_h
+#define APIPolicyClient_h
+
+#include "WebEvent.h"
+#include <WebCore/FrameLoaderTypes.h>
+#include <wtf/Forward.h>
+
+namespace WebCore {
+class ResourceError;
+class ResourceRequest;
+class ResourceResponse;
+}
+
+namespace WebKit {
+class WebPageProxy;
+class WebFrameProxy;
+class WebFramePolicyListenerProxy;
+}
+
+namespace API {
+class Object;
+
+class PolicyClient {
+public:
+    virtual ~PolicyClient() { }
+
+    virtual void decidePolicyForNavigationAction(WebKit::WebPageProxy*, WebKit::WebFrameProxy*, WebCore::NavigationType, WebKit::WebEvent::Modifiers, WebKit::WebMouseEvent::Button, WebKit::WebFrameProxy* originatingFrame, const WebCore::ResourceRequest& originalRequest, const WebCore::ResourceRequest&, WebKit::WebFramePolicyListenerProxy*, API::Object* userData) = 0;
+    virtual void decidePolicyForNewWindowAction(WebKit::WebPageProxy*, WebKit::WebFrameProxy*, WebCore::NavigationType, WebKit::WebEvent::Modifiers, WebKit::WebMouseEvent::Button, const WebCore::ResourceRequest&, const WTF::String& frameName, WebKit::WebFramePolicyListenerProxy*, API::Object* userData) = 0;
+    virtual void decidePolicyForResponse(WebKit::WebPageProxy*, WebKit::WebFrameProxy*, const WebCore::ResourceResponse&, const WebCore::ResourceRequest&, bool canShowMIMEType, WebKit::WebFramePolicyListenerProxy*, API::Object* userData) = 0;
+    virtual void unableToImplementPolicy(WebKit::WebPageProxy*, WebKit::WebFrameProxy*, const WebCore::ResourceError&, API::Object* userData) = 0;
+};
+
+} // namespace API
+
+#endif // APIPolicyClient_h
index bb139bc..a89410c 100644 (file)
@@ -34,6 +34,7 @@
 #include "WKPluginInformation.h"
 #include "WebBackForwardList.h"
 #include "WebPageProxy.h"
+#include "WebPolicyClient.h"
 #include "WebProcessProxy.h"
 #include <WebCore/Page.h>
 
@@ -672,7 +673,7 @@ void WKPageSetPageLoaderClient(WKPageRef pageRef, const WKPageLoaderClientBase*
 
 void WKPageSetPagePolicyClient(WKPageRef pageRef, const WKPagePolicyClientBase* wkClient)
 {
-    toImpl(pageRef)->initializePolicyClient(wkClient);
+    toImpl(pageRef)->setPolicyClient(std::make_unique<WebPolicyClient>(wkClient));
 }
 
 void WKPageSetPageUIClient(WKPageRef pageRef, const WKPageUIClientBase* wkClient)
index ce3341d..47a877c 100644 (file)
@@ -57,6 +57,7 @@
 #import "WebCertificateInfo.h"
 #import "WebContext.h"
 #import "WebPageProxy.h"
+#import "WebPolicyClient.h"
 
 using namespace WebCore;
 using namespace WebKit;
@@ -712,7 +713,7 @@ static void setUpPagePolicyClient(WKBrowsingContextController *browsingContext,
             WKFramePolicyListenerUse(listener);
     };
 
-    page.initializePolicyClient(&policyClient.base);
+    page.setPolicyClient(std::make_unique<WebPolicyClient>(&policyClient.base));
 }
 
 - (id <WKBrowsingContextLoadDelegate>)loadDelegate
@@ -742,7 +743,7 @@ static void setUpPagePolicyClient(WKBrowsingContextController *browsingContext,
     if (policyDelegate)
         setUpPagePolicyClient(self, *_page);
     else
-        _page->initializePolicyClient(nullptr);
+        _page->setPolicyClient(nullptr);
 }
 
 - (id <WKBrowsingContextHistoryDelegate>)historyDelegate
index e6cb964..4f263d8 100644 (file)
@@ -37,6 +37,7 @@
 #include "WebPageCreationParameters.h"
 #include "WebPageGroup.h"
 #include "WebPageProxy.h"
+#include "WebPolicyClient.h"
 #include "WebPreferences.h"
 #include "WebProcessProxy.h"
 #include <WebCore/SchemeRegistry.h>
@@ -449,7 +450,7 @@ void WebInspectorProxy::createInspectorPage(uint64_t& inspectorPageID, WebPageCr
         0, /* decidePolicyForResponse */
     };
 
-    inspectorPage->initializePolicyClient(reinterpret_cast<const WKPagePolicyClientBase*>(&policyClient));
+    inspectorPage->setPolicyClient(std::make_unique<WebPolicyClient>(&policyClient.base));
 
     String url = inspectorPageURL();
 
index 1178bc1..a9998b2 100644 (file)
@@ -420,9 +420,9 @@ void WebPageProxy::initializeLoaderClient(const WKPageLoaderClientBase* loadClie
     m_process->send(Messages::WebPage::SetWillGoToBackForwardItemCallbackEnabled(loadClient->version > 0), m_pageID);
 }
 
-void WebPageProxy::initializePolicyClient(const WKPagePolicyClientBase* policyClient)
+void WebPageProxy::setPolicyClient(std::unique_ptr<API::PolicyClient> policyClient)
 {
-    m_policyClient.initialize(policyClient);
+    m_policyClient = std::move(policyClient);
 }
 
 void WebPageProxy::initializeFormClient(const WKPageFormClientBase* formClient)
@@ -560,7 +560,7 @@ void WebPageProxy::close()
     resetState();
 
     m_loaderClient.initialize(0);
-    m_policyClient.initialize(0);
+    m_policyClient = nullptr;
     m_formClient.initialize(0);
     m_uiClient.initialize(0);
 #if PLATFORM(EFL)
@@ -2458,9 +2458,11 @@ void WebPageProxy::decidePolicyForNavigationAction(uint64_t frameID, uint32_t op
 
     m_inDecidePolicyForNavigationAction = true;
     m_syncNavigationActionPolicyActionIsValid = false;
-    
-    if (!m_policyClient.decidePolicyForNavigationAction(this, frame, navigationType, modifiers, mouseButton, originatingFrame, originalRequest, request, listener.get(), userData.get()))
+
+    if (!m_policyClient)
         listener->use();
+    else
+        m_policyClient->decidePolicyForNavigationAction(this, frame, navigationType, modifiers, mouseButton, originatingFrame, originalRequest, request, listener.get(), userData.get());
 
     m_inDecidePolicyForNavigationAction = false;
 
@@ -2486,10 +2488,12 @@ void WebPageProxy::decidePolicyForNewWindowAction(uint64_t frameID, uint32_t opa
     NavigationType navigationType = static_cast<NavigationType>(opaqueNavigationType);
     WebEvent::Modifiers modifiers = static_cast<WebEvent::Modifiers>(opaqueModifiers);
     WebMouseEvent::Button mouseButton = static_cast<WebMouseEvent::Button>(opaqueMouseButton);
-
     RefPtr<WebFramePolicyListenerProxy> listener = frame->setUpPolicyListenerProxy(listenerID);
-    if (!m_policyClient.decidePolicyForNewWindowAction(this, frame, navigationType, modifiers, mouseButton, request, frameName, listener.get(), userData.get()))
+
+    if (!m_policyClient)
         listener->use();
+    else
+        m_policyClient->decidePolicyForNewWindowAction(this, frame, navigationType, modifiers, mouseButton, request, frameName, listener.get(), userData.get());
 }
 
 void WebPageProxy::decidePolicyForResponse(uint64_t frameID, const ResourceResponse& response, const ResourceRequest& request, bool canShowMIMEType, uint64_t listenerID, IPC::MessageDecoder& decoder)
@@ -2506,8 +2510,10 @@ void WebPageProxy::decidePolicyForResponse(uint64_t frameID, const ResourceRespo
 
     RefPtr<WebFramePolicyListenerProxy> listener = frame->setUpPolicyListenerProxy(listenerID);
 
-    if (!m_policyClient.decidePolicyForResponse(this, frame, response, request, canShowMIMEType, listener.get(), userData.get()))
+    if (!m_policyClient)
         listener->use();
+    else
+        m_policyClient->decidePolicyForResponse(this, frame, response, request, canShowMIMEType, listener.get(), userData.get());
 }
 
 void WebPageProxy::decidePolicyForResponseSync(uint64_t frameID, const ResourceResponse& response, const ResourceRequest& request, bool canShowMIMEType, uint64_t listenerID, IPC::MessageDecoder& decoder, bool& receivedPolicyAction, uint64_t& policyAction, uint64_t& downloadID)
@@ -2541,7 +2547,8 @@ void WebPageProxy::unableToImplementPolicy(uint64_t frameID, const ResourceError
     WebFrameProxy* frame = m_process->webFrame(frameID);
     MESSAGE_CHECK(frame);
 
-    m_policyClient.unableToImplementPolicy(this, frame, error, userData.get());
+    if (m_policyClient)
+        m_policyClient->unableToImplementPolicy(this, frame, error, userData.get());
 }
 
 // FormClient
index f40cff2..736835a 100644 (file)
@@ -27,6 +27,7 @@
 #define WebPageProxy_h
 
 #include "APIObject.h"
+#include "APIPolicyClient.h"
 #include "APISession.h"
 #include "AutoCorrectionCallback.h"
 #include "Connection.h"
@@ -57,7 +58,6 @@
 #include "WebPageCreationParameters.h"
 #include <WebCore/AlternativeTextClient.h> // FIXME: Needed by WebPageProxyMessages.h for DICTATION_ALTERNATIVES.
 #include "WebPageProxyMessages.h"
-#include "WebPolicyClient.h"
 #include "WebPopupMenuProxy.h"
 #include "WebUIClient.h"
 #include <WebCore/Color.h>
@@ -368,7 +368,7 @@ public:
     void initializeFindMatchesClient(const WKPageFindMatchesClientBase*);
     void initializeFormClient(const WKPageFormClientBase*);
     void initializeLoaderClient(const WKPageLoaderClientBase*);
-    void initializePolicyClient(const WKPagePolicyClientBase*);
+    void setPolicyClient(std::unique_ptr<API::PolicyClient>);
     void initializeUIClient(const WKPageUIClientBase*);
 #if PLATFORM(EFL)
     void initializeUIPopupMenuClient(const WKPageUIPopupMenuClientBase*);
@@ -1164,7 +1164,7 @@ private:
 
     PageClient& m_pageClient;
     WebLoaderClient m_loaderClient;
-    WebPolicyClient m_policyClient;
+    std::unique_ptr<API::PolicyClient> m_policyClient;
     WebFormClient m_formClient;
     WebUIClient m_uiClient;
 #if PLATFORM(EFL)
index f9de92a..4b9bb9e 100644 (file)
 #include "APIObject.h"
 #include "APIURLRequest.h"
 #include "WKAPICast.h"
+#include "WebFramePolicyListenerProxy.h"
 
 using namespace WebCore;
 
 namespace WebKit {
 
-bool WebPolicyClient::decidePolicyForNavigationAction(WebPageProxy* page, WebFrameProxy* frame, NavigationType type, WebEvent::Modifiers modifiers, WebMouseEvent::Button mouseButton, WebFrameProxy* originatingFrame, const ResourceRequest& originalResourceRequest, const ResourceRequest& resourceRequest, WebFramePolicyListenerProxy* listener, API::Object* userData)
+WebPolicyClient::WebPolicyClient(const WKPagePolicyClientBase* client)
 {
-    if (!m_client.decidePolicyForNavigationAction_deprecatedForUseWithV0 && !m_client.decidePolicyForNavigationAction_deprecatedForUseWithV1 && !m_client.decidePolicyForNavigationAction)
-        return false;
+    initialize(client);
+}
+
+void WebPolicyClient::decidePolicyForNavigationAction(WebPageProxy* page, WebFrameProxy* frame, WebCore::NavigationType type, WebEvent::Modifiers modifiers, WebMouseEvent::Button mouseButton, WebFrameProxy* originatingFrame, const WebCore::ResourceRequest& originalResourceRequest, const WebCore::ResourceRequest& resourceRequest, WebFramePolicyListenerProxy* listener, API::Object* userData)
+{
+    if (!m_client.decidePolicyForNavigationAction_deprecatedForUseWithV0 && !m_client.decidePolicyForNavigationAction_deprecatedForUseWithV1 && !m_client.decidePolicyForNavigationAction) {
+        listener->use();
+        return;
+    }
 
     RefPtr<API::URLRequest> originalRequest = API::URLRequest::create(originalResourceRequest);
     RefPtr<API::URLRequest> request = API::URLRequest::create(resourceRequest);
@@ -48,25 +56,26 @@ bool WebPolicyClient::decidePolicyForNavigationAction(WebPageProxy* page, WebFra
         m_client.decidePolicyForNavigationAction_deprecatedForUseWithV1(toAPI(page), toAPI(frame), toAPI(type), toAPI(modifiers), toAPI(mouseButton), toAPI(originatingFrame), toAPI(request.get()), toAPI(listener), toAPI(userData), m_client.base.clientInfo);
     else
         m_client.decidePolicyForNavigationAction(toAPI(page), toAPI(frame), toAPI(type), toAPI(modifiers), toAPI(mouseButton), toAPI(originatingFrame), toAPI(originalRequest.get()), toAPI(request.get()), toAPI(listener), toAPI(userData), m_client.base.clientInfo);
-
-    return true;
 }
 
-bool WebPolicyClient::decidePolicyForNewWindowAction(WebPageProxy* page, WebFrameProxy* frame, NavigationType type, WebEvent::Modifiers modifiers, WebMouseEvent::Button mouseButton, const ResourceRequest& resourceRequest, const String& frameName, WebFramePolicyListenerProxy* listener, API::Object* userData)
+void WebPolicyClient::decidePolicyForNewWindowAction(WebPageProxy* page, WebFrameProxy* frame, NavigationType type, WebEvent::Modifiers modifiers, WebMouseEvent::Button mouseButton, const ResourceRequest& resourceRequest, const String& frameName, WebFramePolicyListenerProxy* listener, API::Object* userData)
 {
-    if (!m_client.decidePolicyForNewWindowAction)
-        return false;
+    if (!m_client.decidePolicyForNewWindowAction) {
+        listener->use();
+        return;
+    }
 
     RefPtr<API::URLRequest> request = API::URLRequest::create(resourceRequest);
 
     m_client.decidePolicyForNewWindowAction(toAPI(page), toAPI(frame), toAPI(type), toAPI(modifiers), toAPI(mouseButton), toAPI(request.get()), toAPI(frameName.impl()), toAPI(listener), toAPI(userData), m_client.base.clientInfo);
-    return true;
 }
 
-bool WebPolicyClient::decidePolicyForResponse(WebPageProxy* page, WebFrameProxy* frame, const ResourceResponse& resourceResponse, const ResourceRequest& resourceRequest, bool canShowMIMEType, WebFramePolicyListenerProxy* listener, API::Object* userData)
+void WebPolicyClient::decidePolicyForResponse(WebPageProxy* page, WebFrameProxy* frame, const ResourceResponse& resourceResponse, const ResourceRequest& resourceRequest, bool canShowMIMEType, WebFramePolicyListenerProxy* listener, API::Object* userData)
 {
-    if (!m_client.decidePolicyForResponse_deprecatedForUseWithV0 && !m_client.decidePolicyForResponse)
-        return false;
+    if (m_client.decidePolicyForResponse_deprecatedForUseWithV0 && !m_client.decidePolicyForResponse) {
+        listener->use();
+        return;
+    }
 
     RefPtr<API::URLResponse> response = API::URLResponse::create(resourceResponse);
     RefPtr<API::URLRequest> request = API::URLRequest::create(resourceRequest);
@@ -75,8 +84,6 @@ bool WebPolicyClient::decidePolicyForResponse(WebPageProxy* page, WebFrameProxy*
         m_client.decidePolicyForResponse_deprecatedForUseWithV0(toAPI(page), toAPI(frame), toAPI(response.get()), toAPI(request.get()), toAPI(listener), toAPI(userData), m_client.base.clientInfo);
     else
         m_client.decidePolicyForResponse(toAPI(page), toAPI(frame), toAPI(response.get()), toAPI(request.get()), canShowMIMEType, toAPI(listener), toAPI(userData), m_client.base.clientInfo);
-
-    return true;
 }
 
 void WebPolicyClient::unableToImplementPolicy(WebPageProxy* page, WebFrameProxy* frame, const ResourceError& error, API::Object* userData)
index 8b150c1..4f8561b 100644 (file)
@@ -27,6 +27,7 @@
 #define WebPolicyClient_h
 
 #include "APIClient.h"
+#include "APIPolicyClient.h"
 #include "WKPage.h"
 #include "WKPagePolicyClientInternal.h"
 #include "WebEvent.h"
@@ -41,24 +42,17 @@ template<> struct ClientTraits<WKPagePolicyClientBase> {
 };
 }
 
-namespace WebCore {
-class ResourceError;
-class ResourceRequest;
-class ResourceResponse;
-}
-
 namespace WebKit {
 
-class WebPageProxy;
-class WebFrameProxy;
-class WebFramePolicyListenerProxy;
-
-class WebPolicyClient : public API::Client<WKPagePolicyClientBase> {
+class WebPolicyClient final : public API::Client<WKPagePolicyClientBase>, public API::PolicyClient {
 public:
-    bool decidePolicyForNavigationAction(WebPageProxy*, WebFrameProxy*, WebCore::NavigationType, WebEvent::Modifiers, WebMouseEvent::Button, WebFrameProxy* originatingFrame, const WebCore::ResourceRequest& originalRequest, const WebCore::ResourceRequest&, WebFramePolicyListenerProxy*, API::Object* userData);
-    bool decidePolicyForNewWindowAction(WebPageProxy*, WebFrameProxy*, WebCore::NavigationType, WebEvent::Modifiers, WebMouseEvent::Button, const WebCore::ResourceRequest&, const String& frameName, WebFramePolicyListenerProxy*, API::Object* userData);
-    bool decidePolicyForResponse(WebPageProxy*, WebFrameProxy*, const WebCore::ResourceResponse&, const WebCore::ResourceRequest&, bool canShowMIMEType, WebFramePolicyListenerProxy*, API::Object* userData);
-    void unableToImplementPolicy(WebPageProxy*, WebFrameProxy*, const WebCore::ResourceError&, API::Object* userData);
+    explicit WebPolicyClient(const WKPagePolicyClientBase*);
+
+private:
+    virtual void decidePolicyForNavigationAction(WebPageProxy*, WebFrameProxy*, WebCore::NavigationType, WebEvent::Modifiers, WebMouseEvent::Button, WebFrameProxy* originatingFrame, const WebCore::ResourceRequest& originalRequest, const WebCore::ResourceRequest&, WebFramePolicyListenerProxy*, API::Object* userData) override;
+    virtual void decidePolicyForNewWindowAction(WebKit::WebPageProxy*, WebKit::WebFrameProxy*, WebCore::NavigationType, WebKit::WebEvent::Modifiers, WebKit::WebMouseEvent::Button, const WebCore::ResourceRequest&, const String& frameName, WebKit::WebFramePolicyListenerProxy*, API::Object* userData) override;
+    virtual void decidePolicyForResponse(WebPageProxy*, WebFrameProxy*, const WebCore::ResourceResponse&, const WebCore::ResourceRequest&, bool canShowMIMEType, WebFramePolicyListenerProxy*, API::Object* userData) override;
+    virtual void unableToImplementPolicy(WebPageProxy*, WebFrameProxy*, const WebCore::ResourceError&, API::Object* userData) override;
 };
 
 } // namespace WebKit
index 3740ad4..528ff73 100644 (file)
                1AF05D8714688348008B1E81 /* TiledCoreAnimationDrawingAreaProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AF05D8514688348008B1E81 /* TiledCoreAnimationDrawingAreaProxy.h */; };
                1AF1AC6B1651759E00C17D7F /* RemoteLayerTreeTransaction.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1AF1AC691651759E00C17D7F /* RemoteLayerTreeTransaction.mm */; };
                1AF1AC6C1651759E00C17D7F /* RemoteLayerTreeTransaction.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AF1AC6A1651759E00C17D7F /* RemoteLayerTreeTransaction.h */; };
+               1AFDD3151891B54000153970 /* APIPolicyClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AFDD3141891B54000153970 /* APIPolicyClient.h */; };
                1AFF49001833DE78009AB15A /* WKDeprecatedFunctions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AFF48FE1833DE78009AB15A /* WKDeprecatedFunctions.cpp */; };
                1C8E25A81270E3BB00BC7BD0 /* WebInspectorFrontendClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1C8E256B1270DE3800BC7BD0 /* WebInspectorFrontendClient.cpp */; };
                1C8E25A91270E3BC00BC7BD0 /* WebInspectorFrontendClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 1C8E256A1270DE3800BC7BD0 /* WebInspectorFrontendClient.h */; };
                1AF05D8514688348008B1E81 /* TiledCoreAnimationDrawingAreaProxy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TiledCoreAnimationDrawingAreaProxy.h; sourceTree = "<group>"; };
                1AF1AC691651759E00C17D7F /* RemoteLayerTreeTransaction.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RemoteLayerTreeTransaction.mm; sourceTree = "<group>"; };
                1AF1AC6A1651759E00C17D7F /* RemoteLayerTreeTransaction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RemoteLayerTreeTransaction.h; sourceTree = "<group>"; };
+               1AFDD3141891B54000153970 /* APIPolicyClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APIPolicyClient.h; sourceTree = "<group>"; };
                1AFF48FE1833DE78009AB15A /* WKDeprecatedFunctions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKDeprecatedFunctions.cpp; sourceTree = "<group>"; };
                1BB417C912C00CCA002BE67B /* TextCheckerCompletion.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TextCheckerCompletion.cpp; sourceTree = "<group>"; };
                1C77C1951288A872006A742F /* WebInspectorProxy.messages.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = WebInspectorProxy.messages.in; sourceTree = "<group>"; };
                                37C4C08318149C2A003688B9 /* Cocoa */,
                                BC8A501311765F4500757573 /* cpp */,
                                BC111B47112F616900337BAB /* mac */,
+                               1AFDD3141891B54000153970 /* APIPolicyClient.h */,
                        );
                        path = API;
                        sourceTree = "<group>";
                                37F623B812A57B6200E3FDF6 /* WKFindOptions.h in Headers */,
                                BCE4695A1214EDF4000B98EB /* WKFormSubmissionListener.h in Headers */,
                                BCD0139B110FA420003B8A67 /* WKFrame.h in Headers */,
+                               1AFDD3151891B54000153970 /* APIPolicyClient.h in Headers */,
                                BCB9F6A51123DD0D00A137E0 /* WKFramePolicyListener.h in Headers */,
                                E1AEA22F14687BDB00804569 /* WKFullKeyboardAccessWatcher.h in Headers */,
                                CDCA85C9132ABA4E00E961DF /* WKFullScreenWindowController.h in Headers */,