diff options
author | Michal Klocek <michal.klocek@qt.io> | 2021-06-02 19:40:10 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2021-06-25 05:23:05 +0000 |
commit | 5616249d243fda35312def89424a8ad62f1b9bce (patch) | |
tree | b899e93efaee5f08ebb29b720604a62ac24a62d1 /src | |
parent | d8d02172a12a6cd2f66aee9c90b6f0ef85221e92 (diff) |
Make default profile off the record
Make default profile otr, this prevents accessing
data cache which could be created by older other
version of Chromium. Allow to register a protocol
handler on ort profile.
[ChangeLog][QtWebEngineCore] Default profile is off-the-record
Off-the-record profile can have registered protocol handlers.
Task-number: QTBUG-66068
Change-Id: Ief202de5c6734d293cb64d83ad447b1eba19e9a4
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit d0ff107c0096fa0e0347ddadda9a98438d27631e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/core/api/qwebengineprofile.cpp | 2 | ||||
-rw-r--r-- | src/core/web_contents_delegate_qt.cpp | 4 | ||||
-rw-r--r-- | src/core/web_engine_context.cpp | 2 |
3 files changed, 2 insertions, 6 deletions
diff --git a/src/core/api/qwebengineprofile.cpp b/src/core/api/qwebengineprofile.cpp index 29edc3afb..4074a4c31 100644 --- a/src/core/api/qwebengineprofile.cpp +++ b/src/core/api/qwebengineprofile.cpp @@ -666,7 +666,7 @@ std::function<void(std::unique_ptr<QWebEngineNotification>)> QWebEngineProfile:: /*! Returns the default profile. - The default profile uses the storage name "Default". + The default profile is off-the-record. \sa storageName() */ diff --git a/src/core/web_contents_delegate_qt.cpp b/src/core/web_contents_delegate_qt.cpp index a04ef700b..afa48a5b1 100644 --- a/src/core/web_contents_delegate_qt.cpp +++ b/src/core/web_contents_delegate_qt.cpp @@ -794,8 +794,6 @@ bool WebContentsDelegateQt::CheckMediaAccessPermission(content::RenderFrameHost void WebContentsDelegateQt::RegisterProtocolHandler(content::RenderFrameHost *frameHost, const std::string &protocol, const GURL &url, bool) { content::BrowserContext *context = frameHost->GetBrowserContext(); - if (context->IsOffTheRecord()) - return; ProtocolHandler handler = ProtocolHandler::CreateProtocolHandler(protocol, url); @@ -813,8 +811,6 @@ void WebContentsDelegateQt::RegisterProtocolHandler(content::RenderFrameHost *fr void WebContentsDelegateQt::UnregisterProtocolHandler(content::RenderFrameHost *frameHost, const std::string &protocol, const GURL &url, bool) { content::BrowserContext* context = frameHost->GetBrowserContext(); - if (context->IsOffTheRecord()) - return; ProtocolHandler handler = ProtocolHandler::CreateProtocolHandler(protocol, url); diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp index 83abd17b6..3806d3e7e 100644 --- a/src/core/web_engine_context.cpp +++ b/src/core/web_engine_context.cpp @@ -525,7 +525,7 @@ ProfileAdapter *WebEngineContext::createDefaultProfileAdapter() { Q_ASSERT(!m_destroyed); if (!m_defaultProfileAdapter) { - ProfileAdapter *profile = new ProfileAdapter(QStringLiteral("Default")); + ProfileAdapter *profile = new ProfileAdapter(); // profile when added to m_profileAdapters might be set default // profile in case of single-process if (!m_defaultProfileAdapter) |