fix: broken OOP window.print()
on macOS/Linux (#45214)
fix: broken OOP printing on macOS/Linux
This commit is contained in:
parent
51a249f380
commit
7d05fb2a1b
1 changed files with 25 additions and 0 deletions
|
@ -31,6 +31,11 @@
|
|||
#include "components/services/print_compositor/public/mojom/print_compositor.mojom.h" // nogncheck
|
||||
#endif // BUILDFLAG(ENABLE_PRINTING)
|
||||
|
||||
#if BUILDFLAG(ENABLE_OOP_PRINTING)
|
||||
#include "chrome/services/printing/print_backend_service_impl.h"
|
||||
#include "chrome/services/printing/public/mojom/print_backend_service.mojom.h"
|
||||
#endif // BUILDFLAG(ENABLE_OOP_PRINTING)
|
||||
|
||||
#if BUILDFLAG(ENABLE_PRINTING) && BUILDFLAG(IS_WIN)
|
||||
#include "chrome/services/printing/pdf_to_emf_converter_factory.h"
|
||||
#endif
|
||||
|
@ -72,6 +77,21 @@ auto RunPrintCompositor(
|
|||
}
|
||||
#endif
|
||||
|
||||
#if BUILDFLAG(ENABLE_OOP_PRINTING)
|
||||
auto RunPrintingSandboxedPrintBackendHost(
|
||||
mojo::PendingReceiver<printing::mojom::SandboxedPrintBackendHost>
|
||||
receiver) {
|
||||
return std::make_unique<printing::SandboxedPrintBackendHostImpl>(
|
||||
std::move(receiver));
|
||||
}
|
||||
auto RunPrintingUnsandboxedPrintBackendHost(
|
||||
mojo::PendingReceiver<printing::mojom::UnsandboxedPrintBackendHost>
|
||||
receiver) {
|
||||
return std::make_unique<printing::UnsandboxedPrintBackendHostImpl>(
|
||||
std::move(receiver));
|
||||
}
|
||||
#endif // BUILDFLAG(ENABLE_OOP_PRINTING)
|
||||
|
||||
auto RunProxyResolver(
|
||||
mojo::PendingReceiver<proxy_resolver::mojom::ProxyResolverFactory>
|
||||
receiver) {
|
||||
|
@ -122,6 +142,11 @@ void ElectronContentUtilityClient::RegisterMainThreadServices(
|
|||
services.Add(RunPrintCompositor);
|
||||
#endif
|
||||
|
||||
#if BUILDFLAG(ENABLE_OOP_PRINTING)
|
||||
services.Add(RunPrintingSandboxedPrintBackendHost);
|
||||
services.Add(RunPrintingUnsandboxedPrintBackendHost);
|
||||
#endif
|
||||
|
||||
#if BUILDFLAG(ENABLE_PRINT_PREVIEW) || \
|
||||
(BUILDFLAG(ENABLE_PRINTING) && BUILDFLAG(IS_WIN))
|
||||
services.Add(RunPrintingService);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue