summaryrefslogtreecommitdiff
path: root/Source/WebKit2/UIProcess/API/gtk/WebKitLoaderClient.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebKit2/UIProcess/API/gtk/WebKitLoaderClient.cpp')
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/WebKitLoaderClient.cpp33
1 files changed, 26 insertions, 7 deletions
diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitLoaderClient.cpp b/Source/WebKit2/UIProcess/API/gtk/WebKitLoaderClient.cpp
index 1eae26753..36cd6c0e6 100644
--- a/Source/WebKit2/UIProcess/API/gtk/WebKitLoaderClient.cpp
+++ b/Source/WebKit2/UIProcess/API/gtk/WebKitLoaderClient.cpp
@@ -21,7 +21,6 @@
#include "config.h"
#include "WebKitLoaderClient.h"
-#include "WebKit2GtkAuthenticationDialog.h"
#include "WebKitBackForwardListPrivate.h"
#include "WebKitURIResponsePrivate.h"
#include "WebKitWebViewBasePrivate.h"
@@ -57,8 +56,11 @@ static void didFailProvisionalLoadWithErrorForFrame(WKPageRef page, WKFrameRef f
GOwnPtr<GError> webError(g_error_new_literal(g_quark_from_string(resourceError.domain().utf8().data()),
resourceError.errorCode(),
resourceError.localizedDescription().utf8().data()));
- webkitWebViewLoadFailed(WEBKIT_WEB_VIEW(clientInfo), WEBKIT_LOAD_STARTED,
- resourceError.failingURL().utf8().data(), webError.get());
+ if (resourceError.tlsErrors()) {
+ webkitWebViewLoadFailedWithTLSErrors(WEBKIT_WEB_VIEW(clientInfo), resourceError.failingURL().utf8().data(), webError.get(),
+ static_cast<GTlsCertificateFlags>(resourceError.tlsErrors()), resourceError.certificate());
+ } else
+ webkitWebViewLoadFailed(WEBKIT_WEB_VIEW(clientInfo), WEBKIT_LOAD_STARTED, resourceError.failingURL().utf8().data(), webError.get());
}
static void didCommitLoadForFrame(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void* clientInfo)
@@ -106,6 +108,16 @@ static void didReceiveTitleForFrame(WKPageRef page, WKStringRef titleRef, WKFram
webkitWebViewSetTitle(WEBKIT_WEB_VIEW(clientInfo), toImpl(titleRef)->string().utf8());
}
+static void didDisplayInsecureContentForFrame(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void *clientInfo)
+{
+ webkitWebViewInsecureContentDetected(WEBKIT_WEB_VIEW(clientInfo), WEBKIT_INSECURE_CONTENT_DISPLAYED);
+}
+
+static void didRunInsecureContentForFrame(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void *clientInfo)
+{
+ webkitWebViewInsecureContentDetected(WEBKIT_WEB_VIEW(clientInfo), WEBKIT_INSECURE_CONTENT_RUN);
+}
+
static void didChangeProgress(WKPageRef page, const void* clientInfo)
{
webkitWebViewSetEstimatedLoadProgress(WEBKIT_WEB_VIEW(clientInfo), WKPageGetEstimatedProgress(page));
@@ -121,6 +133,11 @@ static void didReceiveAuthenticationChallengeInFrame(WKPageRef page, WKFrameRef
webkitWebViewHandleAuthenticationChallenge(WEBKIT_WEB_VIEW(clientInfo), toImpl(authenticationChallenge));
}
+static void processDidCrash(WKPageRef page, const void* clientInfo)
+{
+ webkitWebViewWebProcessCrashed(WEBKIT_WEB_VIEW(clientInfo));
+}
+
void attachLoaderClientToView(WebKitWebView* webView)
{
WKPageLoaderClient wkLoaderClient = {
@@ -138,8 +155,8 @@ void attachLoaderClientToView(WebKitWebView* webView)
0, // didFirstLayoutForFrame
0, // didFirstVisuallyNonEmptyLayoutForFrame
0, // didRemoveFrameFromHierarchy
- 0, // didDisplayInsecureContentForFrame
- 0, // didRunInsecureContentForFrame
+ didDisplayInsecureContentForFrame,
+ didRunInsecureContentForFrame,
0, // canAuthenticateAgainstProtectionSpaceInFrame
didReceiveAuthenticationChallengeInFrame,
didChangeProgress, // didStartProgress
@@ -147,7 +164,7 @@ void attachLoaderClientToView(WebKitWebView* webView)
didChangeProgress, // didFinishProgress
0, // didBecomeUnresponsive
0, // didBecomeResponsive
- 0, // processDidCrash
+ processDidCrash,
didChangeBackForwardList,
0, // shouldGoToBackForwardListItem
0, // didFailToInitializePlugin
@@ -155,10 +172,12 @@ void attachLoaderClientToView(WebKitWebView* webView)
0, // didFirstVisuallyNonEmptyLayoutForFrame
0, // willGoToBackForwardListItem
0, // interactionOccurredWhileProcessUnresponsive
- 0, // pluginDidFail
+ 0, // pluginDidFail_deprecatedForUseWithV1
0, // didReceiveIntentForFrame
0, // registerIntentServiceForFrame
0, // didLayout
+ 0, // pluginLoadPolicy
+ 0, // pluginDidFail
};
WKPageRef wkPage = toAPI(webkitWebViewBaseGetPage(WEBKIT_WEB_VIEW_BASE(webView)));
WKPageSetPageLoaderClient(wkPage, &wkLoaderClient);