summaryrefslogtreecommitdiffstats
path: root/src/core/web_contents_delegate_qt.cpp
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2017-11-30 08:17:04 +0000
committerThe Qt Project <gerrit-noreply@qt-project.org>2017-11-30 08:17:04 +0000
commit71e02bc92c8f93f1063f79507b2250a229db6380 (patch)
tree491ff43dfe9878069548d37e29cc9d713fe1643f /src/core/web_contents_delegate_qt.cpp
parent05574185dab53476294cf62f2067a4147aa0b6eb (diff)
parent8a164aa2cd83d728ce620c2b7199ebc6222b55cb (diff)
Merge "Merge remote-tracking branch 'origin/5.10' into dev" into refs/staging/dev
Diffstat (limited to 'src/core/web_contents_delegate_qt.cpp')
-rw-r--r--src/core/web_contents_delegate_qt.cpp33
1 files changed, 15 insertions, 18 deletions
diff --git a/src/core/web_contents_delegate_qt.cpp b/src/core/web_contents_delegate_qt.cpp
index 54aeac710..25aa9ae04 100644
--- a/src/core/web_contents_delegate_qt.cpp
+++ b/src/core/web_contents_delegate_qt.cpp
@@ -132,10 +132,21 @@ content::WebContents *WebContentsDelegateQt::OpenURLFromTab(content::WebContents
void WebContentsDelegateQt::NavigationStateChanged(content::WebContents* source, content::InvalidateTypes changed_flags)
{
- if (changed_flags & content::INVALIDATE_TYPE_URL)
- m_viewClient->urlChanged(toQt(source->GetVisibleURL()));
- if (changed_flags & content::INVALIDATE_TYPE_TITLE)
- m_viewClient->titleChanged(toQt(source->GetTitle()));
+ if (changed_flags & content::INVALIDATE_TYPE_URL) {
+ QUrl newUrl = toQt(source->GetVisibleURL());
+ if (m_url != newUrl) {
+ m_url = newUrl;
+ m_viewClient->urlChanged(m_url);
+ }
+ }
+
+ if (changed_flags & content::INVALIDATE_TYPE_TITLE) {
+ QString newTitle = toQt(source->GetTitle());
+ if (m_title != newTitle) {
+ m_title = newTitle;
+ m_viewClient->titleChanged(m_title);
+ }
+ }
// NavigationStateChanged gets called with INVALIDATE_TYPE_TAB by AudioStateProvider::Notify,
// whenever an audio sound gets played or stopped, this is the only way to actually figure out
@@ -147,20 +158,6 @@ void WebContentsDelegateQt::NavigationStateChanged(content::WebContents* source,
}
}
-bool WebContentsDelegateQt::ShouldPreserveAbortedURLs(content::WebContents *source)
-{
- Q_UNUSED(source)
-
- // Allow failed URLs to stick around in the URL bar, but only when the error-page is enabled.
- WebEngineSettings *settings = m_viewClient->webEngineSettings();
- bool isErrorPageEnabled = settings->testAttribute(settings->Attribute::ErrorPageEnabled);
-
- if (isErrorPageEnabled)
- return true;
-
- return false;
-}
-
void WebContentsDelegateQt::AddNewContents(content::WebContents* source, content::WebContents* new_contents, WindowOpenDisposition disposition, const gfx::Rect& initial_pos, bool user_gesture, bool* was_blocked)
{
Q_UNUSED(source)