summaryrefslogtreecommitdiffstats
path: root/src/core/web_contents_delegate_qt.cpp
diff options
context:
space:
mode:
authorErwin Kandler <e.kandler@gmail.com>2018-08-21 10:46:31 +0200
committerKai Koehne <kai.koehne@qt.io>2018-08-29 13:06:36 +0000
commit0c97d942b0d723f7efbb31f651d2bd75f5537da9 (patch)
treebe62256087de8e0ed36e3397639169a2e6556377 /src/core/web_contents_delegate_qt.cpp
parent33d4b696eba33804da06ae9dda7997feb8b1c50e (diff)
Return http status code for successfully loaded pages
WebEngineView supports getting the http status code (error code) for failed loading requests only. This patch lets the user access the status code for successfully loaded pages as well. Change-Id: Ib8dbdfe94eed4d62e731c736c13f60ebd62a23fa Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Diffstat (limited to 'src/core/web_contents_delegate_qt.cpp')
-rw-r--r--src/core/web_contents_delegate_qt.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/core/web_contents_delegate_qt.cpp b/src/core/web_contents_delegate_qt.cpp
index 7f1604162..36703c225 100644
--- a/src/core/web_contents_delegate_qt.cpp
+++ b/src/core/web_contents_delegate_qt.cpp
@@ -376,7 +376,11 @@ void WebContentsDelegateQt::DidFinishLoad(content::RenderFrameHost* render_frame
if (!m_faviconManager->hasCandidate())
m_viewClient->iconChanged(QUrl());
- EmitLoadFinished(true, toQt(validated_url));
+ content::NavigationEntry *entry = web_contents()->GetController().GetActiveEntry();
+ int http_statuscode = 0;
+ if (entry)
+ http_statuscode = entry->GetHttpStatusCode();
+ EmitLoadFinished(true /* success */ , toQt(validated_url), false /* isErrorPage */, http_statuscode);
}
void WebContentsDelegateQt::DidUpdateFaviconURL(const std::vector<content::FaviconURL> &candidates)