diff options
author | Peter Varga <pvarga@inf.u-szeged.hu> | 2022-11-15 17:08:21 +0100 |
---|---|---|
committer | Peter Varga <pvarga@inf.u-szeged.hu> | 2022-11-24 09:12:04 +0100 |
commit | 20198450e392555b870e6448ca5544958924bb87 (patch) | |
tree | ae5b16bfdd44fe53e2d2aa712ed4980b3a5dd65e /src/core/content_browser_client_qt.cpp | |
parent | a68221ee023d05a5482b93f483b8030f8242e532 (diff) |
Fix build with disabled webengine_extensions
PDF viewer depends on extensions. Guard these dependencies to make able
to build with disabled webengine_extensions and enabled
webengine_printing_and_pdf.
The PDF Viewer is not expected to work with this configuration but the
build should pass and loading a PDF should result a download.
Pick-to: 6.4
Change-Id: I4d75e356951c82333ec3dbcd7b6271b9305de3df
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'src/core/content_browser_client_qt.cpp')
-rw-r--r-- | src/core/content_browser_client_qt.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/core/content_browser_client_qt.cpp b/src/core/content_browser_client_qt.cpp index 2f214bbb7..6f9f94d6d 100644 --- a/src/core/content_browser_client_qt.cpp +++ b/src/core/content_browser_client_qt.cpp @@ -856,12 +856,12 @@ std::vector<std::unique_ptr<content::NavigationThrottle>> ContentBrowserClientQt base::BindRepeating(&navigationThrottleCallback), navigation_interception::SynchronyMode::kSync)); -#if BUILDFLAG(ENABLE_PDF) -#if BUILDFLAG(ENABLE_EXTENSIONS) - MaybeAddThrottle(extensions::PDFIFrameNavigationThrottleQt::MaybeCreateThrottleFor(navigation_handle), &throttles); -#endif // BUILDFLAG(ENABLE_EXTENSIONS) +#if BUILDFLAG(ENABLE_PDF) && BUILDFLAG(ENABLE_EXTENSIONS) + MaybeAddThrottle( + extensions::PDFIFrameNavigationThrottleQt::MaybeCreateThrottleFor(navigation_handle), + &throttles); MaybeAddThrottle(pdf::PdfNavigationThrottle::MaybeCreateThrottleFor(navigation_handle, std::make_unique<PdfStreamDelegateQt>()), &throttles); -#endif // BUILDFLAG(ENABLE_PDF) +#endif // BUILDFLAG(ENABLE_PDF) && BUIDLFLAG(ENABLE_EXTENSIONS) return throttles; } @@ -1238,7 +1238,7 @@ ContentBrowserClientQt::WillCreateURLLoaderRequestInterceptors(content::Navigati const scoped_refptr<network::SharedURLLoaderFactory>& network_loader_factory) { std::vector<std::unique_ptr<content::URLLoaderRequestInterceptor>> interceptors; -#if BUILDFLAG(ENABLE_PDF) +#if BUILDFLAG(ENABLE_PDF) && BUILDFLAG(ENABLE_EXTENSIONS) { std::unique_ptr<content::URLLoaderRequestInterceptor> pdf_interceptor = pdf::PdfURLLoaderRequestInterceptor::MaybeCreateInterceptor( @@ -1246,7 +1246,7 @@ ContentBrowserClientQt::WillCreateURLLoaderRequestInterceptors(content::Navigati if (pdf_interceptor) interceptors.push_back(std::move(pdf_interceptor)); } -#endif +#endif // BUILDFLAG(ENABLE_PDF) && BUIDLFLAG(ENABLE_EXTENSIONS) return interceptors; } |