diff options
author | Szabolcs David <davidsz@inf.u-szeged.hu> | 2017-10-12 16:35:05 +0200 |
---|---|---|
committer | Szabolcs David <davidsz@inf.u-szeged.hu> | 2017-10-17 07:58:27 +0000 |
commit | 664c2a58603a82cb52056dd3fa3491900d2015f2 (patch) | |
tree | 421d561e0f0e55d59d9cf43f272eda49f1081098 /src/core/web_contents_delegate_qt.cpp | |
parent | ee5070f95be237b0ced7e53c5ce7ffde68e57c99 (diff) |
Mark redirecting URLs as visited
Store the whole redirect chain of finished navigations in the database
of visited links. Chrome does the same thing, except that it implements
NavigationURLLoaderDelegate::OnRequestRedirected() for this purpose.
Task-number: QTBUG-63579
Change-Id: Iff46c33de14c5e1a7386bd1e2860c832e24d5083
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'src/core/web_contents_delegate_qt.cpp')
-rw-r--r-- | src/core/web_contents_delegate_qt.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/core/web_contents_delegate_qt.cpp b/src/core/web_contents_delegate_qt.cpp index 4bf25ff3b..a997c53de 100644 --- a/src/core/web_contents_delegate_qt.cpp +++ b/src/core/web_contents_delegate_qt.cpp @@ -243,9 +243,12 @@ void WebContentsDelegateQt::DidFinishNavigation(content::NavigationHandle *navig return; if (navigation_handle->HasCommitted() && !navigation_handle->IsErrorPage()) { + BrowserContextAdapter *browserContextAdapter = m_viewClient->browserContextAdapter().data(); // VisistedLinksMaster asserts !IsOffTheRecord(). - if (navigation_handle->ShouldUpdateHistory() && m_viewClient->browserContextAdapter()->trackVisitedLinks()) - m_viewClient->browserContextAdapter()->visitedLinksManager()->addUrl(navigation_handle->GetURL()); + if (navigation_handle->ShouldUpdateHistory() && browserContextAdapter->trackVisitedLinks()) { + for (const GURL &url : navigation_handle->GetRedirectChain()) + browserContextAdapter->visitedLinksManager()->addUrl(url); + } // Make sure that we don't set the findNext WebFindOptions on a new frame. m_lastSearchedString = QString(); |