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/renderer/pepper | |
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/renderer/pepper')
-rw-r--r-- | src/core/renderer/pepper/pepper_renderer_host_factory_qt.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/core/renderer/pepper/pepper_renderer_host_factory_qt.cpp b/src/core/renderer/pepper/pepper_renderer_host_factory_qt.cpp index 4acf69043..33c744f13 100644 --- a/src/core/renderer/pepper/pepper_renderer_host_factory_qt.cpp +++ b/src/core/renderer/pepper/pepper_renderer_host_factory_qt.cpp @@ -44,9 +44,13 @@ #include "pepper_renderer_host_factory_qt.h" #include "pepper_flash_renderer_host_qt.h" +#include "qtwebenginecoreglobal_p.h" #include "base/memory/ptr_util.h" #include "chrome/renderer/pepper/pepper_flash_font_file_host.h" +#if QT_CONFIG(webengine_printing_and_pdf) +#include "components/pdf/renderer/pepper_pdf_host.h" +#endif // QT_CONFIG(webengine_printing_and_pdf) #include "content/public/renderer/renderer_ppapi_host.h" #include "ppapi/host/ppapi_host.h" #include "ppapi/host/resource_host.h" @@ -100,7 +104,7 @@ std::unique_ptr<ppapi::host::ResourceHost> PepperRendererHostFactoryQt::CreateRe // We should either rename PPB_FlashFont_File to PPB_FontFile_Private or get // rid of its use in PDF if possible. if (host_->GetPpapiHost()->permissions().HasPermission(ppapi::PERMISSION_FLASH) - || host_->GetPpapiHost()->permissions().HasPermission(ppapi::PERMISSION_PRIVATE)) { + || host_->GetPpapiHost()->permissions().HasPermission(ppapi::PERMISSION_PDF)) { switch (message.type()) { case PpapiHostMsg_FlashFontFile_Create::ID: { ppapi::proxy::SerializedFontDescription description; @@ -115,14 +119,14 @@ std::unique_ptr<ppapi::host::ResourceHost> PepperRendererHostFactoryQt::CreateRe } } - if (host_->GetPpapiHost()->permissions().HasPermission(ppapi::PERMISSION_PRIVATE)) { +#if QT_CONFIG(webengine_printing_and_pdf) + if (host_->GetPpapiHost()->permissions().HasPermission(ppapi::PERMISSION_PDF)) { switch (message.type()) { case PpapiHostMsg_PDF_Create::ID: - // Not implemented - break; + return std::make_unique<pdf::PepperPDFHost>(host_, instance, resource); } } - +#endif // QT_CONFIG(webengine_printing_and_pdf) return nullptr; } |