typedef void (*WKPageDidRunInsecureContentForFrameCallback)(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void *clientInfo);
typedef void (*WKPageDidDetectXSSForFrameCallback)(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void *clientInfo);
typedef bool (*WKPageCanAuthenticateAgainstProtectionSpaceInFrameCallback)(WKPageRef page, WKFrameRef frame, WKProtectionSpaceRef protectionSpace, const void *clientInfo);
+#if ENABLE(TIZEN_ON_AUTHENTICATION_REQUESTED)
+typedef bool (*WKPageDidReceiveAuthenticationChallengeInFrameCallback)(WKPageRef page, WKFrameRef frame, WKAuthenticationChallengeRef authenticationChallenge, const void *clientInfo);
+#else
typedef void (*WKPageDidReceiveAuthenticationChallengeInFrameCallback)(WKPageRef page, WKFrameRef frame, WKAuthenticationChallengeRef authenticationChallenge, const void *clientInfo);
+#endif
typedef void (*WKPageDidChangeBackForwardListCallback)(WKPageRef page, WKBackForwardListItemRef addedItem, WKArrayRef removedItems, const void *clientInfo);
typedef bool (*WKPageShouldGoToBackForwardListItemCallback)(WKPageRef page, WKBackForwardListItemRef item, const void *clientInfo);
typedef void (*WKPageDidNewFirstVisuallyNonEmptyLayoutCallback)(WKPageRef page, WKTypeRef userData, const void *clientInfo);
}
#endif
- if (authChallenge)
- ewkAuthChallengeDelete(authChallenge);
if (policyDecision)
ewkPolicyDecisionDelete(policyDecision);
*/
struct _Ewk_Auth_Challenge {
WKAuthenticationChallengeRef authenticationChallenge;
+#if ENABLE(TIZEN_ON_AUTHENTICATION_REQUESTED)
+ WKPageRef page;
+#endif
CString realm;
CString url;
bool isSuspended;
};
+#if ENABLE(TIZEN_ON_AUTHENTICATION_REQUESTED)
+Ewk_Auth_Challenge* ewkAuthChallengeCreate(WKPageRef page, WKAuthenticationChallengeRef authenticationChallenge)
+#else
Ewk_Auth_Challenge* ewkAuthChallengeCreate(WKAuthenticationChallengeRef authenticationChallenge)
+#endif
{
EINA_SAFETY_ON_NULL_RETURN_VAL(authenticationChallenge, 0);
Ewk_Auth_Challenge* authChallenge = new Ewk_Auth_Challenge;
+#if ENABLE(TIZEN_ON_AUTHENTICATION_REQUESTED)
+ authChallenge->page = page;
+#endif
authChallenge->authenticationChallenge = authenticationChallenge;
authChallenge->realm = toImpl(realmString.get())->string().utf8();
authChallenge->url = toImpl(hostString.get())->string().utf8();
EINA_SAFETY_ON_NULL_RETURN(password);
authChallenge->isDecided = true;
+ toImpl(authChallenge->page)->replyReceiveAuthenticationChallengeInFrame(true);
WKAuthenticationChallengeRef authenticationChallenge = authChallenge->authenticationChallenge;
WKAuthenticationDecisionListenerRef authenticationDecisionListener = WKAuthenticationChallengeGetDecisionListener(authenticationChallenge);
WKRetainPtr<WKCredentialRef> credential(AdoptWK, WKCredentialCreate(userString.get(), passwordString.get(), kWKCredentialPersistenceNone));
WKAuthenticationDecisionListenerUseCredential(authenticationDecisionListener, credential.get());
+ ewkAuthChallengeDelete(authChallenge);
+
}
void ewk_auth_challenge_credential_cancel(Ewk_Auth_Challenge* authChallenge)
EINA_SAFETY_ON_NULL_RETURN(authChallenge);
authChallenge->isDecided = true;
+ toImpl(authChallenge->page)->replyReceiveAuthenticationChallengeInFrame(false);
WKAuthenticationChallengeRef authenticationChallenge = authChallenge->authenticationChallenge;
WKAuthenticationDecisionListenerRef authenticationDecisionListener = WKAuthenticationChallengeGetDecisionListener(authenticationChallenge);
WKAuthenticationDecisionListenerCancel(authenticationDecisionListener);
+ ewkAuthChallengeDelete(authChallenge);
}
#endif // #if OS(TIZEN)
#include "WKAuthenticationChallenge.h"
#include "ewk_auth_challenge.h"
+#if ENABLE(TIZEN_ON_AUTHENTICATION_REQUESTED)
+Ewk_Auth_Challenge* ewkAuthChallengeCreate(WKPageRef page, WKAuthenticationChallengeRef authenticationChallenge);
+#else
Ewk_Auth_Challenge* ewkAuthChallengeCreate(WKAuthenticationChallengeRef authenticationChallenge);
+#endif
void ewkAuthChallengeDelete(Ewk_Auth_Challenge* authChallenge);
bool ewkAuthChallengeDecided(Ewk_Auth_Challenge* authChallenge);
bool ewkAuthChallengeSuspended(Ewk_Auth_Challenge* authChallenge);
-#endif // ewk_auth_challenge_private_h
\ No newline at end of file
+#endif // ewk_auth_challenge_private_h
EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData);
EWK_VIEW_IMPL_GET_OR_RETURN(smartData, impl);
- if (impl->authChallenge)
- ewkAuthChallengeDelete(impl->authChallenge);
impl->authChallenge = authChallenge;
evas_object_smart_callback_call(ewkView, "authentication,challenge", impl->authChallenge);
return m_client.canAuthenticateAgainstProtectionSpaceInFrame(toAPI(page), toAPI(frame), toAPI(protectionSpace), m_client.clientInfo);
}
+#if ENABLE(TIZEN_ON_AUTHENTICATION_REQUESTED)
+bool WebLoaderClient::didReceiveAuthenticationChallengeInFrame(WebPageProxy* page, WebFrameProxy* frame, AuthenticationChallengeProxy* authenticationChallenge)
+{
+ if (!m_client.didReceiveAuthenticationChallengeInFrame)
+ return false;
+
+ return m_client.didReceiveAuthenticationChallengeInFrame(toAPI(page), toAPI(frame), toAPI(authenticationChallenge), m_client.clientInfo);
+}
+#else
void WebLoaderClient::didReceiveAuthenticationChallengeInFrame(WebPageProxy* page, WebFrameProxy* frame, AuthenticationChallengeProxy* authenticationChallenge)
{
if (!m_client.didReceiveAuthenticationChallengeInFrame)
m_client.didReceiveAuthenticationChallengeInFrame(toAPI(page), toAPI(frame), toAPI(authenticationChallenge), m_client.clientInfo);
}
+#endif
void WebLoaderClient::didStartProgress(WebPageProxy* page)
{
void didNewFirstVisuallyNonEmptyLayout(WebPageProxy*, APIObject*);
bool canAuthenticateAgainstProtectionSpaceInFrame(WebPageProxy*, WebFrameProxy*, WebProtectionSpace*);
+#if ENABLE(TIZEN_ON_AUTHENTICATION_REQUESTED)
+ bool didReceiveAuthenticationChallengeInFrame(WebPageProxy*, WebFrameProxy*, AuthenticationChallengeProxy*);
+#else
void didReceiveAuthenticationChallengeInFrame(WebPageProxy*, WebFrameProxy*, AuthenticationChallengeProxy*);
+#endif
void didStartProgress(WebPageProxy*);
void didChangeProgress(WebPageProxy*);
canAuthenticate = m_loaderClient.canAuthenticateAgainstProtectionSpaceInFrame(this, frame, protectionSpace.get());
}
+#if ENABLE(TIZEN_ON_AUTHENTICATION_REQUESTED)
+void WebPageProxy::didReceiveAuthenticationChallenge(uint64_t frameID, const AuthenticationChallenge& coreChallenge, uint64_t challengeID, PassRefPtr<Messages::WebPageProxy::DidReceiveAuthenticationChallenge::DelayedReply> reply)
+#else
void WebPageProxy::didReceiveAuthenticationChallenge(uint64_t frameID, const AuthenticationChallenge& coreChallenge, uint64_t challengeID)
+#endif
{
WebFrameProxy* frame = process()->webFrame(frameID);
MESSAGE_CHECK(frame);
#if ENABLE(TIZEN_ON_AUTHENTICATION_REQUESTED)
RefPtr<AuthenticationChallengeProxy> authenticationChallenge = frame->setUpAuthenticationChallengeProxy(coreChallenge, challengeID, process());
+ m_AuthReply = reply;
+
+ if (!m_loaderClient.didReceiveAuthenticationChallengeInFrame(this, frame, authenticationChallenge.get()))
+ replyReceiveAuthenticationChallengeInFrame(true);
#else
RefPtr<AuthenticationChallengeProxy> authenticationChallenge = AuthenticationChallengeProxy::create(coreChallenge, challengeID, process());
-#endif
m_loaderClient.didReceiveAuthenticationChallengeInFrame(this, frame, authenticationChallenge.get());
+#endif
}
#if ENABLE(TIZEN_SQL_DATABASE)
#endif
#endif
+#if ENABLE(TIZEN_ON_AUTHENTICATION_REQUESTED)
+ void replyReceiveAuthenticationChallengeInFrame(bool result);
+#endif
+
#if ENABLE(TIZEN_CERTIFICATE_HANDLING)
void replyPolicyForCertificateError(bool result);
#endif
void frameSetLargestFrameChanged(uint64_t frameID);
void canAuthenticateAgainstProtectionSpaceInFrame(uint64_t frameID, const WebCore::ProtectionSpace&, bool& canAuthenticate);
+#if ENABLE(TIZEN_ON_AUTHENTICATION_REQUESTED)
+ void didReceiveAuthenticationChallenge(uint64_t frameID, const WebCore::AuthenticationChallenge&, uint64_t challengeID, PassRefPtr<Messages::WebPageProxy::DidReceiveAuthenticationChallenge::DelayedReply>);
+#else
void didReceiveAuthenticationChallenge(uint64_t frameID, const WebCore::AuthenticationChallenge&, uint64_t challengeID);
+#endif
void didFinishLoadingDataForCustomRepresentation(const String& suggestedFilename, const CoreIPC::DataReference&);
#endif
#endif
+#if ENABLE(TIZEN_ON_AUTHENTICATION_REQUESTED)
+ RefPtr<Messages::WebPageProxy::DidReceiveAuthenticationChallenge::DelayedReply> m_AuthReply;
+#endif
+
#if ENABLE(TIZEN_CERTIFICATE_HANDLING)
RefPtr<Messages::WebPageProxy::DecidePolicyForCertificateError::DelayedReply> m_allowedReply;
#endif
# Authentication messages
CanAuthenticateAgainstProtectionSpaceInFrame(uint64_t frameID, WebCore::ProtectionSpace protectionSpace) -> (bool canAuthenticate)
+#if ENABLE(TIZEN_ON_AUTHENTICATION_REQUESTED)
+ DidReceiveAuthenticationChallenge(uint64_t frameID, WebCore::AuthenticationChallenge challenge, uint64_t challengeID) -> (bool canAuthenticate) Delayed
+#endif
+#if !ENABLE(TIZEN_ON_AUTHENTICATION_REQUESTED)
DidReceiveAuthenticationChallenge(uint64_t frameID, WebCore::AuthenticationChallenge challenge, uint64_t challengeID)
+#endif
# Database messages
#if ENABLE(TIZEN_SQL_DATABASE)
ewkViewDidFirstVisuallyNonEmptyLayout(ewkView);
}
+#if ENABLE(TIZEN_ON_AUTHENTICATION_REQUESTED)
+bool PageLoadClientEfl::didReceiveAuthenticationChallengeInFrame(WKPageRef page, WKFrameRef frame, WKAuthenticationChallengeRef authenticationChallenge, const void* clientInfo)
+{
+#if !ENABLE(TIZEN_AUTHENTICATION_CHALLENGE_ENABLED_IN_ALL_FRAMES)
+ if (!WKFrameIsMainFrame(frame))
+ return false;
+#endif
+
+ Evas_Object* ewkView = toPageLoadClientEfl(clientInfo)->viewImpl()->view();
+ Ewk_Auth_Challenge* authChallenge = ewkAuthChallengeCreate(page, authenticationChallenge);
+ ewkViewDidReceiveAuthenticationChallenge(ewkView, authChallenge);
+
+ if (!ewkAuthChallengeDecided(authChallenge) && !ewkAuthChallengeSuspended(authChallenge))
+ ewk_auth_challenge_credential_cancel(authChallenge);
+
+ return true;
+}
+#else
void PageLoadClientEfl::didReceiveAuthenticationChallengeInFrame(WKPageRef page, WKFrameRef frame, WKAuthenticationChallengeRef authenticationChallenge, const void* clientInfo)
{
#if !ENABLE(TIZEN_AUTHENTICATION_CHALLENGE_ENABLED_IN_ALL_FRAMES)
if (!ewkAuthChallengeDecided(authChallenge) && !ewkAuthChallengeSuspended(authChallenge))
ewk_auth_challenge_credential_cancel(authChallenge);
}
+#endif
void PageLoadClientEfl::processDidCrash(WKPageRef page, const void* clientInfo)
{
#if OS(TIZEN)
static void didCommitLoadForFrame(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void* clientInfo);
static void didFirstVisuallyNonEmptyLayoutForFrame(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void* clientInfo);
+#if ENABLE(TIZEN_ON_AUTHENTICATION_REQUESTED)
+ static bool didReceiveAuthenticationChallengeInFrame(WKPageRef page, WKFrameRef frame, WKAuthenticationChallengeRef authenticationChallenge, const void* clientInfo);
+#else
static void didReceiveAuthenticationChallengeInFrame(WKPageRef page, WKFrameRef frame, WKAuthenticationChallengeRef authenticationChallenge, const void* clientInfo);
+#endif
static void processDidCrash(WKPageRef page, const void* clientInfo);
#if ENABLE(TIZEN_WEBKIT2_SEPERATE_LOAD_PROGRESS)
static void didStartProgress(WKPageRef page, const void* clientInfo);
}
#endif
+#if ENABLE(TIZEN_ON_AUTHENTICATION_REQUESTED)
+void WebPageProxy::replyReceiveAuthenticationChallengeInFrame(bool result)
+{
+ if (!m_AuthReply)
+ return;
+
+ m_AuthReply->send(result);
+ m_AuthReply = nullptr;
+}
+#endif
+
#if ENABLE(TIZEN_CERTIFICATE_HANDLING)
void WebPageProxy::replyPolicyForCertificateError(bool result)
{
uint64_t challengeID = generateAuthenticationChallengeID();
m_challenges.set(challengeID, authenticationChallenge);
-
+
+#if ENABLE(TIZEN_ON_AUTHENTICATION_REQUESTED)
+ bool canAuthenticate = false;
+ WebProcess::shared().connection()->sendSync(Messages::WebPageProxy::DidReceiveAuthenticationChallenge(frame->frameID(), authenticationChallenge, challengeID), Messages::WebPageProxy::DidReceiveAuthenticationChallenge::Reply(canAuthenticate), frame->page()->pageID());
+#else
WebProcess::shared().connection()->send(Messages::WebPageProxy::DidReceiveAuthenticationChallenge(frame->frameID(), authenticationChallenge, challengeID), frame->page()->pageID());
+#endif
}
void AuthenticationManager::didReceiveAuthenticationChallenge(Download* download, const AuthenticationChallenge& authenticationChallenge)