summaryrefslogtreecommitdiffstats
path: root/src/core/web_contents_delegate_qt.cpp
diff options
context:
space:
mode:
authorPeter Varga <pvarga@inf.u-szeged.hu>2018-05-16 09:36:24 +0200
committerPeter Varga <pvarga@inf.u-szeged.hu>2018-05-17 08:32:30 +0000
commitbab4ababd097fd90b227a5a1bca63343b97af091 (patch)
tree3765bf3196f10453a38d973fd8ed2916c33ddd9d /src/core/web_contents_delegate_qt.cpp
parent8476245d1a197d05f988ef87f17b7ccbbcbba878 (diff)
Keep settings synchronized when RVH swaps
There can be more than one RenderViewHost assigned to a single WebContents. This is the case when starting a page load results changing processes. When applying settings during the load it updates only the old RVH. This fix applies the settings to the new RVH too after the swap. Task-number: QTBUG-66656 Change-Id: I833415b2a34f58e2a9a18c209a025c82b73aa65a 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.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/core/web_contents_delegate_qt.cpp b/src/core/web_contents_delegate_qt.cpp
index aae7f4a43..7f3ced8aa 100644
--- a/src/core/web_contents_delegate_qt.cpp
+++ b/src/core/web_contents_delegate_qt.cpp
@@ -527,6 +527,17 @@ void WebContentsDelegateQt::ActivateContents(content::WebContents* contents)
contents->Focus();
}
+void WebContentsDelegateQt::RenderViewHostChanged(content::RenderViewHost *old_host, content::RenderViewHost *new_host)
+{
+ Q_ASSERT(new_host);
+
+ // The old RVH can be nullptr if it was shut down.
+ if (!old_host)
+ return;
+
+ new_host->UpdateWebkitPreferences(old_host->GetWebkitPreferences());
+}
+
void WebContentsDelegateQt::RequestToLockMouse(content::WebContents *web_contents, bool user_gesture, bool last_unlocked_by_target)
{
Q_UNUSED(user_gesture);