diff options
author | Michael BrĂ¼ning <michael.bruning@qt.io> | 2019-01-22 18:03:00 +0100 |
---|---|---|
committer | Michael BrĂ¼ning <michael.bruning@qt.io> | 2019-02-01 10:26:00 +0000 |
commit | e3968360b4f1b7b0603b97d50244b18c92207f21 (patch) | |
tree | d326be003ca43991bacc8685a07a051f4e46c898 /src/core/profile_adapter.cpp | |
parent | 3bff0bae7e0c660fc25c5c46dedaf9cb89563a58 (diff) |
Add extension system and PDF viewer to Qt WebEngine
Adds the Chromium extensiuon system to Qt WebEngine.
Currently, it only exposes internal APIs to the internal
PDF viewer extension.
To load a PDF, simply navigate to it.
This feature can be configured via the webengine-extensions flag
and is turned on by default.
Needs patch in Chromium 71-based to build.
Adaptations to 71-based from 69-based include:
* Flag out update installation, add crx file dependency
* Move PostTask over to 71-based implementation
* Move extensions API providers to 71-based implementaion
* Don't use custom guest view and mime handler view delegates
* Adapt the URLRequestResourceBundleJob to match new interface
* Move extension system initialization to end of profile constructor
Change-Id: I4fa5149057291bb5847f048534c11820cd7ff58c
Fixes: QTBUG-50556
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'src/core/profile_adapter.cpp')
-rw-r--r-- | src/core/profile_adapter.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/core/profile_adapter.cpp b/src/core/profile_adapter.cpp index dfe701cc9..48a6906e9 100644 --- a/src/core/profile_adapter.cpp +++ b/src/core/profile_adapter.cpp @@ -58,6 +58,10 @@ #include "components/keyed_service/content/browser_context_dependency_manager.h" +#if BUILDFLAG(ENABLE_EXTENSIONS) +#include "extensions/browser/extension_system.h" +#endif + #include <QCoreApplication> #include <QDir> #include <QString> @@ -93,6 +97,10 @@ ProfileAdapter::ProfileAdapter(const QString &storageName): // fixme: this should not be here m_profile->m_profileIOData->initializeOnUIThread(); m_customUrlSchemeHandlers.insert(QByteArrayLiteral("qrc"), &m_qrcHandler); +#if BUILDFLAG(ENABLE_EXTENSIONS) + if (!storageName.isEmpty()) + extensions::ExtensionSystem::Get(m_profile.data())->InitForRegularProfile(true); +#endif } ProfileAdapter::~ProfileAdapter() |