summaryrefslogtreecommitdiffstats
path: root/src/core/web_contents_adapter.cpp
diff options
context:
space:
mode:
authorPeter Varga <pvarga@inf.u-szeged.hu>2014-09-24 11:42:26 +0200
committerPeter Varga <pvarga@inf.u-szeged.hu>2014-10-07 13:41:01 +0200
commit8bbfa1fe12b88a8cd1e27652ed54d1afc4d872e2 (patch)
tree08f1626688bee706eaf301eee46f770841da2582 /src/core/web_contents_adapter.cpp
parent093667a70fb2b12bb7dca333674854d2696aac27 (diff)
Fix WebContentsAdapater::requestedUrl() function
The requestedUrl function didn't return empty URL even if the empty URL was really requested. It was assumed if GetOriginalRequestURL returned empty string that means the requested url was not set in the navigation entry. This fix handles that case when empty url is set in the navigation entry as requested url. If the navigation entry is in pending state that means the request url has not been set yet thus the actual URL should be returned. Change-Id: Ic2eff5c487686f7c0e349a7a34a86b80551a002f Reviewed-by: Andras Becsi <andras.becsi@digia.com>
Diffstat (limited to 'src/core/web_contents_adapter.cpp')
-rw-r--r--src/core/web_contents_adapter.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/core/web_contents_adapter.cpp b/src/core/web_contents_adapter.cpp
index 739b3b423..3533c0743 100644
--- a/src/core/web_contents_adapter.cpp
+++ b/src/core/web_contents_adapter.cpp
@@ -454,10 +454,15 @@ QUrl WebContentsAdapter::activeUrl() const
QUrl WebContentsAdapter::requestedUrl() const
{
Q_D(const WebContentsAdapter);
- if (content::NavigationEntry* entry = d->webContents->GetController().GetVisibleEntry()) {
+ content::NavigationEntry* entry = d->webContents->GetController().GetVisibleEntry();
+ content::NavigationEntry* pendingEntry = d->webContents->GetController().GetPendingEntry();
+
+ if (entry) {
if (!entry->GetOriginalRequestURL().is_empty())
return toQt(entry->GetOriginalRequestURL());
- return toQt(entry->GetURL());
+
+ if (pendingEntry && pendingEntry == entry)
+ return toQt(entry->GetURL());
}
return QUrl();
}