summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/core/CMakeLists.txt4
-rw-r--r--src/core/browser_main_parts_qt.cpp2
-rw-r--r--src/core/content_browser_client_qt.cpp14
-rw-r--r--src/core/web_contents_adapter.cpp2
4 files changed, 11 insertions, 11 deletions
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt
index 644f1d558..ed14bbd31 100644
--- a/src/core/CMakeLists.txt
+++ b/src/core/CMakeLists.txt
@@ -230,8 +230,6 @@ foreach(arch ${archs})
extend_gn_target(${buildGn} CONDITION QT_FEATURE_webengine_printing_and_pdf
SOURCES
printing/pdfium_document_wrapper_qt.cpp printing/pdfium_document_wrapper_qt.h
- printing/pdf_web_contents_helper_client_qt.cpp printing/pdf_web_contents_helper_client_qt.h
- printing/pdf_stream_delegate_qt.cpp printing/pdf_stream_delegate_qt.h
printing/print_view_manager_base_qt.cpp printing/print_view_manager_base_qt.h
printing/print_view_manager_qt.cpp printing/print_view_manager_qt.h
printing/printer_worker.cpp printing/printer_worker.h
@@ -273,6 +271,8 @@ foreach(arch ${archs})
extend_gn_target(${buildGn} CONDITION QT_FEATURE_webengine_extensions AND QT_FEATURE_webengine_printing_and_pdf
SOURCES
extensions/pdf_iframe_navigation_throttle_qt.cpp extensions/pdf_iframe_navigation_throttle_qt.h
+ printing/pdf_stream_delegate_qt.cpp printing/pdf_stream_delegate_qt.h
+ printing/pdf_web_contents_helper_client_qt.cpp printing/pdf_web_contents_helper_client_qt.h
)
extend_gn_target(${buildGn} CONDITION WIN32
diff --git a/src/core/browser_main_parts_qt.cpp b/src/core/browser_main_parts_qt.cpp
index a39a1ee3b..e58822c29 100644
--- a/src/core/browser_main_parts_qt.cpp
+++ b/src/core/browser_main_parts_qt.cpp
@@ -277,12 +277,12 @@ int BrowserMainPartsQt::PreMainMessageLoopRun()
extensions::ExtensionsClient::Set(new extensions::ExtensionsClientQt());
extensions::ExtensionsBrowserClient::Set(new extensions::ExtensionsBrowserClientQt());
extensions::ExtensionSystemFactoryQt::GetInstance();
-#endif // BUILDFLAG(ENABLE_EXTENSIONS)
#if BUILDFLAG(ENABLE_PLUGINS)
content::PluginService *plugin_service = content::PluginService::GetInstance();
plugin_service->SetFilter(extensions::PluginServiceFilterQt::GetInstance());
#endif // BUILDFLAG(ENABLE_PLUGINS)
+#endif // BUILDFLAG(ENABLE_EXTENSIONS)
if (base::FeatureList::IsEnabled(features::kWebUsb)) {
m_webUsbDetector.reset(new WebUsbDetectorQt());
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;
}
diff --git a/src/core/web_contents_adapter.cpp b/src/core/web_contents_adapter.cpp
index 9c0f85a2a..98128ee74 100644
--- a/src/core/web_contents_adapter.cpp
+++ b/src/core/web_contents_adapter.cpp
@@ -491,7 +491,7 @@ void WebContentsAdapter::initialize(content::SiteInstance *site)
webContents(), AutofillClientQt::FromWebContents(webContents()),
/* app_locale = */ "", autofill::AutofillManager::DISABLE_AUTOFILL_DOWNLOAD_MANAGER);
-#if QT_CONFIG(webengine_printing_and_pdf)
+#if QT_CONFIG(webengine_printing_and_pdf) && QT_CONFIG(webengine_extensions)
pdf::PDFWebContentsHelper::CreateForWebContentsWithClient(
webContents(), std::make_unique<PDFWebContentsHelperClientQt>());
#endif