WebURLAuthenticationChallengeSenderCurl.cpp [plain text]
#include "WebKitDLL.h"
#include <initguid.h>
#include "WebURLAuthenticationChallengeSender.h"
#include "WebKit.h"
#include "WebURLAuthenticationChallenge.h"
#include "WebURLCredential.h"
#include <WebCore/COMPtr.h>
#include <WebCore/ResourceHandle.h>
using namespace WebCore;
HRESULT WebURLAuthenticationChallengeSender::cancelAuthenticationChallenge(
IWebURLAuthenticationChallenge* challenge)
{
COMPtr<WebURLAuthenticationChallenge> webChallenge(Query, challenge);
if (!webChallenge)
return E_FAIL;
m_client->receivedCancellation(webChallenge->authenticationChallenge());
return S_OK;
}
HRESULT WebURLAuthenticationChallengeSender::continueWithoutCredentialForAuthenticationChallenge(
IWebURLAuthenticationChallenge* challenge)
{
COMPtr<WebURLAuthenticationChallenge> webChallenge(Query, challenge);
if (!webChallenge)
return E_FAIL;
m_client->receivedRequestToContinueWithoutCredential(webChallenge->authenticationChallenge());
return S_OK;
}
HRESULT WebURLAuthenticationChallengeSender::useCredential(
IWebURLCredential* credential,
IWebURLAuthenticationChallenge* challenge)
{
COMPtr<WebURLAuthenticationChallenge> webChallenge(Query, challenge);
if (!webChallenge)
return E_FAIL;
COMPtr<WebURLCredential> webCredential;
if (!credential || FAILED(credential->QueryInterface(__uuidof(WebURLCredential), (void**)&webCredential)))
return E_FAIL;
m_client->receivedCredential(webChallenge->authenticationChallenge(), webCredential->credential());
return S_OK;
}