summaryrefslogtreecommitdiffstats
path: root/src/core/content_browser_client_qt.cpp
diff options
context:
space:
mode:
authorPeter Varga <pvarga@inf.u-szeged.hu>2022-08-24 09:54:39 +0200
committerPeter Varga <pvarga@inf.u-szeged.hu>2022-08-24 16:10:41 +0200
commitd3ceb65253b18cea470339ec5064778e253f5d58 (patch)
treeabb9057a6a12eb8d8b8022e21afe64e328bdace7 /src/core/content_browser_client_qt.cpp
parentd44d934fc18b2c1e0608761d6de9b0758f637e94 (diff)
Fix build with disabled webengine_printing_and_pdf
Now the extensions can be enabled when printing is disabled. Pick-to: 6.4 Change-Id: I6183c795298eedf9cdf5110e580e73ba88f45828 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.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/core/content_browser_client_qt.cpp b/src/core/content_browser_client_qt.cpp
index 67fd8456d..a1868715c 100644
--- a/src/core/content_browser_client_qt.cpp
+++ b/src/core/content_browser_client_qt.cpp
@@ -40,6 +40,7 @@
#include "net/ssl/client_cert_identity.h"
#include "net/ssl/client_cert_store.h"
#include "net/ssl/ssl_private_key.h"
+#include "printing/buildflags/buildflags.h"
#include "services/device/public/cpp/geolocation/geolocation_manager.h"
#include "services/network/network_service.h"
#include "services/network/public/cpp/web_sandbox_flags.h"
@@ -132,7 +133,6 @@
#include "extensions/common/manifest_handlers/mime_types_handler.h"
#include "extensions/extension_web_contents_observer_qt.h"
#include "extensions/extensions_browser_client_qt.h"
-#include "extensions/pdf_iframe_navigation_throttle_qt.h"
#include "net/plugin_response_interceptor_url_loader_throttle.h"
#endif
@@ -142,17 +142,20 @@
#endif
#if BUILDFLAG(ENABLE_PRINTING) && BUILDFLAG(ENABLE_PRINT_PREVIEW)
+#include "printing/pdf_stream_delegate_qt.h"
#include "printing/print_view_manager_qt.h"
#endif
#if BUILDFLAG(ENABLE_PDF)
-#include "printing/pdf_stream_delegate_qt.h"
-
#include "components/pdf/browser/pdf_navigation_throttle.h"
#include "components/pdf/browser/pdf_url_loader_request_interceptor.h"
#include "components/pdf/browser/pdf_web_contents_helper.h"
#endif
+#if BUILDFLAG(ENABLE_PDF) && BUILDFLAG(ENABLE_EXTENSIONS)
+#include "extensions/pdf_iframe_navigation_throttle_qt.h"
+#endif
+
#include <QGuiApplication>
#include <QStandardPaths>
#include <qpa/qplatformnativeinterface.h>
@@ -851,12 +854,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
-#if BUILDFLAG(ENABLE_PDF)
+#endif // BUILDFLAG(ENABLE_EXTENSIONS)
MaybeAddThrottle(pdf::PdfNavigationThrottle::MaybeCreateThrottleFor(navigation_handle, std::make_unique<PdfStreamDelegateQt>()), &throttles);
-#endif // BUILDFLAG(ENABLE_PDF)
+#endif // BUILDFLAG(ENABLE_PDF)
return throttles;
}