+2007-10-15 Alice Liu <alice.liu@apple.com>\r
+\r
+ removing fixed test\r
+\r
+ * platform/win/Skipped:\r
+
2007-10-15 Kevin McCullough <kmccullough@apple.com>
Reviewed by Sam.
editing/selection/5354455-1.html
editing/selection/5354455-2.html
-# layoutTestController.setCustomPolicyDelegate is unimplemented <rdar://problem/5382546>
-http/tests/security/feed-urls-from-remote.html
-
# These tests time out <rdar://problem/5382558>
http/tests/security/cross-frame-access-protocol-explicit-domain.html
http/tests/security/cross-frame-access-protocol.html
+2007-10-15 Alice Liu <alice.liu@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Fixed <rdar://5382546> layoutTestController.setCustomPolicyDelegate is unimplemented causing tests to fail
+
+ * DefaultPolicyDelegate.cpp: Added.
+ Implementation is a direct port of WebKit/DefaultDelegates/WebDefaultPolicyDelegate.m
+ (DefaultPolicyDelegate::DefaultPolicyDelegate):
+ (DefaultPolicyDelegate::~DefaultPolicyDelegate):
+ (DefaultPolicyDelegate::sharedInstance):
+ (DefaultPolicyDelegate::createInstance):
+ (DefaultPolicyDelegate::QueryInterface):
+ (DefaultPolicyDelegate::AddRef):
+ (DefaultPolicyDelegate::Release):
+ (DefaultPolicyDelegate::decidePolicyForNavigationAction):
+ (DefaultPolicyDelegate::decidePolicyForNewWindowAction):
+ (DefaultPolicyDelegate::decidePolicyForMIMEType):
+ (DefaultPolicyDelegate::unableToImplementPolicyWithError):
+ * DefaultPolicyDelegate.h: Added.
+ * WebFrame.cpp:
+ (WebFrame::dispatchDecidePolicyForNavigationAction):
+ Implemented default action
+ * WebKit.vcproj/WebKit.vcproj:
+ Adding files to project
+
2007-10-12 Steve Falkenburg <sfalken@apple.com>
Move pthreads up in the linker order and don't mark it for delay load.
--- /dev/null
+/*
+ * Copyright (C) 2007 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 COMPUTER, INC. ``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 COMPUTER, INC. OR
+ * 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 "WebKitDLL.h"
+#include "DefaultPolicyDelegate.h"
+
+#include "IWebViewPrivate.h"
+
+#pragma warning(push, 0)
+#include <WebCore/PlatformString.h>
+#pragma warning(pop)
+
+using namespace WebCore;
+
+// FIXME: move this enum to a separate header file when other code begins to use it.
+typedef enum WebExtraNavigationType {
+ WebNavigationTypePlugInRequest = WebNavigationTypeOther + 1
+} WebExtraNavigationType;
+
+// DefaultPolicyDelegate ----------------------------------------------------------------
+
+DefaultPolicyDelegate::DefaultPolicyDelegate()
+ : m_refCount(0)
+{
+ gClassCount++;
+}
+
+DefaultPolicyDelegate::~DefaultPolicyDelegate()
+{
+ gClassCount--;
+}
+
+DefaultPolicyDelegate* DefaultPolicyDelegate::sharedInstance()
+{
+ static COMPtr<DefaultPolicyDelegate> shared;
+ if (!shared)
+ shared.adoptRef(DefaultPolicyDelegate::createInstance());
+ return shared.get();
+}
+
+DefaultPolicyDelegate* DefaultPolicyDelegate::createInstance()
+{
+ DefaultPolicyDelegate* instance = new DefaultPolicyDelegate();
+ instance->AddRef();
+ return instance;
+}
+
+// IUnknown -------------------------------------------------------------------
+
+HRESULT STDMETHODCALLTYPE DefaultPolicyDelegate::QueryInterface(REFIID riid, void** ppvObject)
+{
+ *ppvObject = 0;
+ if (IsEqualGUID(riid, IID_IUnknown))
+ *ppvObject = static_cast<IUnknown*>(this);
+ else if (IsEqualGUID(riid, IID_IWebPolicyDelegate))
+ *ppvObject = static_cast<IWebPolicyDelegate*>(this);
+ else
+ return E_NOINTERFACE;
+
+ AddRef();
+ return S_OK;
+}
+
+ULONG STDMETHODCALLTYPE DefaultPolicyDelegate::AddRef()
+{
+ return ++m_refCount;
+}
+
+ULONG STDMETHODCALLTYPE DefaultPolicyDelegate::Release()
+{
+ ULONG newRef = --m_refCount;
+ if (!newRef)
+ delete(this);
+
+ return newRef;
+}
+
+HRESULT STDMETHODCALLTYPE DefaultPolicyDelegate::decidePolicyForNavigationAction(
+ /*[in]*/ IWebView* webView,
+ /*[in]*/ IPropertyBag* actionInformation,
+ /*[in]*/ IWebURLRequest* request,
+ /*[in]*/ IWebFrame* /*frame*/,
+ /*[in]*/ IWebPolicyDecisionListener* listener)
+{
+ int navType = 0;
+ VARIANT var;
+ if (SUCCEEDED(actionInformation->Read(WebActionNavigationTypeKey, &var, 0))) {
+ V_VT(&var) = VT_I4;
+ navType = V_I4(&var);
+ }
+ COMPtr<IWebViewPrivate> wvPrivate(Query, webView);
+ if (wvPrivate) {
+ BOOL canHandleRequest = FALSE;
+ if (SUCCEEDED(wvPrivate->canHandleRequest(request, &canHandleRequest)) && canHandleRequest)
+ listener->use();
+ else if (navType == WebNavigationTypePlugInRequest)
+ listener->use();
+ else {
+ BSTR url;
+ // A file URL shouldn't fall through to here, but if it did,
+ // it would be a security risk to open it.
+ if (SUCCEEDED(request->URL(&url)) && !String(url, SysStringLen(url)).startsWith("file:")) {
+ // FIXME: Open the URL not by means of a webframe, but by handing it over to the system and letting it determine how to open that particular URL scheme. See documentation for [NSWorkspace openURL]
+ ;
+ }
+ listener->ignore();
+ SysFreeString(url);
+ }
+ }
+ return S_OK;
+}
+
+HRESULT STDMETHODCALLTYPE DefaultPolicyDelegate::decidePolicyForNewWindowAction(
+ /*[in]*/ IWebView* /*webView*/,
+ /*[in]*/ IPropertyBag* /*actionInformation*/,
+ /*[in]*/ IWebURLRequest* /*request*/,
+ /*[in]*/ BSTR /*frameName*/,
+ /*[in]*/ IWebPolicyDecisionListener* listener)
+{
+ listener->use();
+ return S_OK;
+}
+
+HRESULT STDMETHODCALLTYPE DefaultPolicyDelegate::decidePolicyForMIMEType(
+ /*[in]*/ IWebView* webView,
+ /*[in]*/ BSTR type,
+ /*[in]*/ IWebURLRequest* request,
+ /*[in]*/ IWebFrame* /*frame*/,
+ /*[in]*/ IWebPolicyDecisionListener* listener)
+{
+ BOOL canShowMIMEType;
+ if (FAILED(webView->canShowMIMEType(type, &canShowMIMEType)))
+ canShowMIMEType = FALSE;
+
+ BSTR url;
+ request->URL(&url);
+
+ if (String(url, SysStringLen(url)).startsWith("file:")) {
+ BOOL isDirectory = FALSE;
+ WIN32_FILE_ATTRIBUTE_DATA attrs;
+ if (GetFileAttributesEx(url, GetFileExInfoStandard, &attrs))
+ isDirectory = !!(attrs.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY);
+
+ if (isDirectory)
+ listener->ignore();
+ else if(canShowMIMEType)
+ listener->use();
+ else
+ listener->ignore();
+ } else if (canShowMIMEType)
+ listener->use();
+ else
+ listener->ignore();
+ SysFreeString(url);
+ return S_OK;
+}
+
+HRESULT STDMETHODCALLTYPE DefaultPolicyDelegate::unableToImplementPolicyWithError(
+ /*[in]*/ IWebView* /*webView*/,
+ /*[in]*/ IWebError* error,
+ /*[in]*/ IWebFrame* frame)
+{
+ BSTR errorStr;
+ error->localizedDescription(&errorStr);
+
+ BSTR frameName;
+ frame->name(&frameName);
+
+ LOG_ERROR("called unableToImplementPolicyWithError:%S inFrame:%S", errorStr ? errorStr : TEXT(""), frameName ? frameName : TEXT(""));
+ SysFreeString(errorStr);
+ SysFreeString(frameName);
+
+ return S_OK;
+}
--- /dev/null
+/*
+ * Copyright (C) 2007 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 COMPUTER, INC. ``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 COMPUTER, INC. OR
+ * 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 DefaultPolicyDelegate_h
+#define DefaultPolicyDelegate_h
+
+#include "COMPtr.h"
+#include "IWebPolicyDelegate.h"
+
+class DefaultPolicyDelegate : public IWebPolicyDelegate {
+public:
+ static DefaultPolicyDelegate* sharedInstance();
+ static DefaultPolicyDelegate* createInstance();
+private:
+ DefaultPolicyDelegate();
+ ~DefaultPolicyDelegate();
+public:
+ // IUnknown
+ virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void** ppvObject);
+ virtual ULONG STDMETHODCALLTYPE AddRef(void);
+ virtual ULONG STDMETHODCALLTYPE Release(void);
+
+ // IWebPolicyDelegate
+ virtual HRESULT STDMETHODCALLTYPE decidePolicyForNavigationAction(
+ /* [in] */ IWebView *webView,
+ /* [in] */ IPropertyBag *actionInformation,
+ /* [in] */ IWebURLRequest *request,
+ /* [in] */ IWebFrame *frame,
+ /* [in] */ IWebPolicyDecisionListener *listener);
+
+ virtual HRESULT STDMETHODCALLTYPE decidePolicyForNewWindowAction(
+ /* [in] */ IWebView *webView,
+ /* [in] */ IPropertyBag *actionInformation,
+ /* [in] */ IWebURLRequest *request,
+ /* [in] */ BSTR frameName,
+ /* [in] */ IWebPolicyDecisionListener *listener);
+
+ virtual HRESULT STDMETHODCALLTYPE decidePolicyForMIMEType(
+ /* [in] */ IWebView *webView,
+ /* [in] */ BSTR type,
+ /* [in] */ IWebURLRequest *request,
+ /* [in] */ IWebFrame *frame,
+ /* [in] */ IWebPolicyDecisionListener *listener);
+
+ virtual HRESULT STDMETHODCALLTYPE unableToImplementPolicyWithError(
+ /* [in] */ IWebView *webView,
+ /* [in] */ IWebError *error,
+ /* [in] */ IWebFrame *frame);
+
+protected:
+ ULONG m_refCount;
+};
+
+#endif // DefaultPolicyDelegate_h
#include "CFDictionaryPropertyBag.h"
#include "COMPtr.h"
+#include "DefaultPolicyDelegate.h"
#include "DOMCoreClasses.h"
#include "IWebError.h"
#include "IWebErrorPrivate.h"
ASSERT(coreFrame);
COMPtr<IWebPolicyDelegate> policyDelegate;
- if (SUCCEEDED(d->webView->policyDelegate(&policyDelegate))) {
- COMPtr<IWebURLRequest> urlRequest;
- urlRequest.adoptRef(WebMutableURLRequest::createInstance(request));
- COMPtr<WebActionPropertyBag> actionInformation;
- actionInformation.adoptRef(WebActionPropertyBag::createInstance(action, coreFrame));
+ if (FAILED(d->webView->policyDelegate(&policyDelegate)))
+ policyDelegate = DefaultPolicyDelegate::sharedInstance();
- if (SUCCEEDED(policyDelegate->decidePolicyForNavigationAction(d->webView, actionInformation.get(), urlRequest.get(), this, setUpPolicyListener(function).get())))
- return;
- }
+ COMPtr<IWebURLRequest> urlRequest(AdoptCOM, WebMutableURLRequest::createInstance(request));
+ COMPtr<WebActionPropertyBag> actionInformation(AdoptCOM, WebActionPropertyBag::createInstance(action, coreFrame));
+
+ if (SUCCEEDED(policyDelegate->decidePolicyForNavigationAction(d->webView, actionInformation.get(), urlRequest.get(), this, setUpPolicyListener(function).get())))
+ return;
- // FIXME: Add a sane default implementation
(coreFrame->loader()->*function)(PolicyUse);
}
RelativePath="..\DefaultDownloadDelegate.h"\r
>\r
</File>\r
+ <File\r
+ RelativePath="..\DefaultPolicyDelegate.h"\r
+ >\r
+ </File>\r
<File\r
RelativePath="..\DOMCoreClasses.h"\r
>\r
RelativePath="..\DefaultDownloadDelegate.cpp"\r
>\r
</File>\r
+ <File\r
+ RelativePath="..\DefaultPolicyDelegate.cpp"\r
+ >\r
+ </File>\r
<File\r
RelativePath="..\DOMCoreClasses.cpp"\r
>\r
+2007-10-15 Alice Liu <alice.liu@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Fixed <rdar://5382546> layoutTestController.setCustomPolicyDelegate is unimplemented causing tests to fail
+
+ * DumpRenderTree/win/DumpRenderTree.cpp:
+ (runTest): Like on mac, before running each test, set the webview's policy delegate to null
+ (main): allocate the global policy delegate for DRT's custom use
+ * DumpRenderTree/win/DumpRenderTree.vcproj:
+ Adding files to project
+ * DumpRenderTree/win/DumpRenderTreeWin.h: declaring global DRT policy delegate
+ * DumpRenderTree/win/LayoutTestControllerWin.cpp:
+ (LayoutTestController::setCustomPolicyDelegate):
+ set the webview's policy delegate to DRT's custom one if the test requests it.
+ * DumpRenderTree/win/PolicyDelegate.cpp: Added.
+ Implementation is a direct port of DumpRenderTree/mac/PolicyDelegate.mm
+ (PolicyDelegate::PolicyDelegate):
+ (PolicyDelegate::QueryInterface):
+ (PolicyDelegate::AddRef):
+ (PolicyDelegate::Release):
+ (PolicyDelegate::decidePolicyForNavigationAction):
+ * DumpRenderTree/win/PolicyDelegate.h: Added.
+ (PolicyDelegate::decidePolicyForNewWindowAction):
+ (PolicyDelegate::decidePolicyForMIMEType):
+ (PolicyDelegate::unableToImplementPolicyWithError):
+
2007-10-14 Holger Hans Peter Freyther <zecke@selfish.org>
Reviewed by Mark.
#include "EditingDelegate.h"
#include "FrameLoaderDelegate.h"
#include "LayoutTestController.h"
+#include "PolicyDelegate.h"
#include "UIDelegate.h"
#include "WorkQueueItem.h"
#include "WorkQueue.h"
// that child frame is the "topmost frame that is loading".
IWebFrame* topLoadingFrame; // !nil iff a load is in progress
static COMPtr<IWebHistoryItem> prevTestBFItem; // current b/f item at the end of the previous test
+IWebPolicyDelegate* policyDelegate;
IWebFrame* frame;
HWND webViewWindow;
if (SUCCEEDED(webView->backForwardList(&bfList)))
bfList->currentItem(&prevTestBFItem);
+ webView->setPolicyDelegate(NULL);
+
COMPtr<IWebIBActions> webIBActions;
if (SUCCEEDED(webView->QueryInterface(IID_IWebIBActions, (void**)&webIBActions)))
webIBActions->makeTextStandardSize(0);
if (FAILED(webView->setFrameLoadDelegate(frameLoadDelegate.get())))
return -1;
+ policyDelegate = new PolicyDelegate();
+
COMPtr<UIDelegate> uiDelegate;
uiDelegate.adoptRef(new UIDelegate);
if (FAILED(webView->setUIDelegate(uiDelegate.get())))
if (threaded)
stopJavaScriptThreads();
+ delete policyDelegate;
frame->Release();
if (leakChecking) {
RelativePath=".\FrameLoaderDelegate.h"\r
>\r
</File>\r
+ <File\r
+ RelativePath=".\PolicyDelegate.cpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\PolicyDelegate.h"\r
+ >\r
+ </File>\r
<File\r
RelativePath=".\UIDelegate.cpp"\r
>\r
#define _WINSOCKAPI_ // Prevent inclusion of winsock.h in windows.h
struct IWebFrame;
+struct IWebPolicyDelegate;
typedef struct HWND__* HWND;
extern IWebFrame* topLoadingFrame;
extern IWebFrame* frame;
+extern IWebPolicyDelegate* policyDelegate;
extern HWND webViewWindow;
#include "LayoutTestController.h"
#include "EditingDelegate.h"
+#include "PolicyDelegate.h"
#include "WorkQueue.h"
#include "WorkQueueItem.h"
#include <WebCore/COMPtr.h>
void LayoutTestController::setCustomPolicyDelegate(bool setDelegate)
{
- // FIXME: Implement!
+ COMPtr<IWebView> webView;
+ if (FAILED(frame->webView(&webView)))
+ return;
+
+ if (setDelegate)
+ webView->setPolicyDelegate(policyDelegate);
+ else
+ webView->setPolicyDelegate(NULL);
}
void LayoutTestController::setMainFrameIsFirstResponder(bool flag)
--- /dev/null
+/*
+ * Copyright (C) 2007 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.
+ * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE 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 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 "DumpRenderTree.h"
+#include "PolicyDelegate.h"
+
+#include <string>
+
+using std::wstring;
+
+PolicyDelegate::PolicyDelegate()
+ : m_refCount(1)
+{
+}
+
+// IUnknown
+HRESULT STDMETHODCALLTYPE PolicyDelegate::QueryInterface(REFIID riid, void** ppvObject)
+{
+ *ppvObject = 0;
+ if (IsEqualGUID(riid, IID_IUnknown))
+ *ppvObject = static_cast<IWebPolicyDelegate*>(this);
+ else if (IsEqualGUID(riid, IID_IWebPolicyDelegate))
+ *ppvObject = static_cast<IWebPolicyDelegate*>(this);
+ else
+ return E_NOINTERFACE;
+
+ AddRef();
+ return S_OK;
+}
+
+ULONG STDMETHODCALLTYPE PolicyDelegate::AddRef(void)
+{
+ return ++m_refCount;
+}
+
+ULONG STDMETHODCALLTYPE PolicyDelegate::Release(void)
+{
+ ULONG newRef = --m_refCount;
+ if (!newRef)
+ delete this;
+
+ return newRef;
+}
+
+HRESULT STDMETHODCALLTYPE PolicyDelegate::decidePolicyForNavigationAction(
+ /*[in]*/ IWebView* /*webView*/,
+ /*[in]*/ IPropertyBag* /*actionInformation*/,
+ /*[in]*/ IWebURLRequest* request,
+ /*[in]*/ IWebFrame* frame,
+ /*[in]*/ IWebPolicyDecisionListener* listener)
+{
+ BSTR frameName;
+ frame->name(&frameName);
+
+ BSTR url;
+ request->URL(&url);
+
+ printf("Frame %S attempted to load %S\n", frameName ? frameName : TEXT(""), url ? url : TEXT(""));
+ SysFreeString(frameName);
+ SysFreeString(url);
+ listener->ignore();
+
+ return S_OK;
+}
--- /dev/null
+/*
+ * Copyright (C) 2007 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.
+ * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE 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 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 PolicyDelegate_h
+#define PolicyDelegate_h
+
+#include <WebKit/IWebPolicyDelegate.h>
+
+class PolicyDelegate : public IWebPolicyDelegate {
+public:
+ PolicyDelegate();
+
+ // IUnknown
+ virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void** ppvObject);
+ virtual ULONG STDMETHODCALLTYPE AddRef(void);
+ virtual ULONG STDMETHODCALLTYPE Release(void);
+
+ // IWebPolicyDelegate
+ virtual HRESULT STDMETHODCALLTYPE decidePolicyForNavigationAction(
+ /* [in] */ IWebView *webView,
+ /* [in] */ IPropertyBag *actionInformation,
+ /* [in] */ IWebURLRequest *request,
+ /* [in] */ IWebFrame *frame,
+ /* [in] */ IWebPolicyDecisionListener *listener);
+
+ virtual HRESULT STDMETHODCALLTYPE decidePolicyForNewWindowAction(
+ /* [in] */ IWebView *webView,
+ /* [in] */ IPropertyBag *actionInformation,
+ /* [in] */ IWebURLRequest *request,
+ /* [in] */ BSTR frameName,
+ /* [in] */ IWebPolicyDecisionListener *listener){ return E_NOTIMPL; }
+
+ virtual HRESULT STDMETHODCALLTYPE decidePolicyForMIMEType(
+ /* [in] */ IWebView *webView,
+ /* [in] */ BSTR type,
+ /* [in] */ IWebURLRequest *request,
+ /* [in] */ IWebFrame *frame,
+ /* [in] */ IWebPolicyDecisionListener *listener){ return E_NOTIMPL; }
+
+ virtual HRESULT STDMETHODCALLTYPE unableToImplementPolicyWithError(
+ /* [in] */ IWebView *webView,
+ /* [in] */ IWebError *error,
+ /* [in] */ IWebFrame *frame){ return E_NOTIMPL; }
+
+private:
+ ULONG m_refCount;
+};
+
+#endif // PolicyDelegate_h