diff --git a/atom/utility/atom_content_utility_client.cc b/atom/utility/atom_content_utility_client.cc index ed9781a90461..f95c8fffa70c 100644 --- a/atom/utility/atom_content_utility_client.cc +++ b/atom/utility/atom_content_utility_client.cc @@ -4,7 +4,6 @@ #include "atom/utility/atom_content_utility_client.h" -#include #include #include "base/command_line.h" @@ -95,11 +94,6 @@ void AtomContentUtilityClient::RegisterServices(StaticServiceMap* services) { proxy_resolver_info); #if BUILDFLAG(ENABLE_PRINTING) - service_manager::EmbeddedServiceInfo pdf_compositor_info; - pdf_compositor_info.factory = - base::BindRepeating(&printing::CreatePdfCompositorService, std::string()); - services->emplace(printing::mojom::kServiceName, pdf_compositor_info); - service_manager::EmbeddedServiceInfo printing_info; printing_info.factory = base::BindRepeating(&printing::PrintingService::CreateService); @@ -107,4 +101,18 @@ void AtomContentUtilityClient::RegisterServices(StaticServiceMap* services) { #endif } +std::unique_ptr +AtomContentUtilityClient::HandleServiceRequest( + const std::string& service_name, + service_manager::mojom::ServiceRequest request) { +#if BUILDFLAG(ENABLE_PRINTING) + if (service_name == printing::mojom::kServiceName) { + return printing::CreatePdfCompositorService(std::string(), + std::move(request)); + } +#endif + + return nullptr; +} + } // namespace atom diff --git a/atom/utility/atom_content_utility_client.h b/atom/utility/atom_content_utility_client.h index 12f70dccf744..fc5f4a89d6ef 100644 --- a/atom/utility/atom_content_utility_client.h +++ b/atom/utility/atom_content_utility_client.h @@ -6,6 +6,7 @@ #define ATOM_UTILITY_ATOM_CONTENT_UTILITY_CLIENT_H_ #include +#include #include #include "base/compiler_specific.h" @@ -27,6 +28,10 @@ class AtomContentUtilityClient : public content::ContentUtilityClient { bool OnMessageReceived(const IPC::Message& message) override; void RegisterServices(StaticServiceMap* services) override; + std::unique_ptr HandleServiceRequest( + const std::string& service_name, + service_manager::mojom::ServiceRequest request) override; + private: #if BUILDFLAG(ENABLE_PRINTING) && defined(OS_WIN) std::unique_ptr printing_handler_;