Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(209)

Unified Diff: chrome/utility/chrome_content_utility_client.cc

Issue 2832633002: Add PDF compositor service (Closed)
Patch Set: rebase more Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/utility/chrome_content_utility_client.cc
diff --git a/chrome/utility/chrome_content_utility_client.cc b/chrome/utility/chrome_content_utility_client.cc
index 3a028e79c35ef2a9739f997cf052bb7046dd3996..2aea23f64eab67bfa2573c33648f8e8ef2bd22b8 100644
--- a/chrome/utility/chrome_content_utility_client.cc
+++ b/chrome/utility/chrome_content_utility_client.cc
@@ -56,6 +56,12 @@
#include "chrome/utility/printing_handler.h"
#endif
+#if BUILDFLAG(ENABLE_PRINTING)
+#include "chrome/common/chrome_content_client.h"
+#include "components/printing/service/public/cpp/pdf_compositor_service_factory.h"
+#include "components/printing/service/public/interfaces/pdf_compositor.mojom.h" // nogncheck
+#endif
+
#if defined(FULL_SAFE_BROWSING)
#include "chrome/common/safe_archive_analyzer.mojom.h"
#include "chrome/common/safe_browsing/zip_analyzer.h"
@@ -320,6 +326,17 @@ bool ChromeContentUtilityClient::OnMessageReceived(
return false;
}
+void ChromeContentUtilityClient::RegisterServices(
+ ChromeContentUtilityClient::StaticServiceMap* services) {
+#if BUILDFLAG(ENABLE_PRINTING)
+ content::ServiceInfo pdf_compositor_info;
+ pdf_compositor_info.factory =
+ base::Bind(&printing::CreatePdfCompositorService, GetUserAgent());
+ services->insert(
dcheng 2017/05/10 07:36:48 Ditto: let's use emplace() now
Wei Li 2017/05/11 16:53:01 Done.
+ std::make_pair(printing::mojom::kServiceName, pdf_compositor_info));
+#endif
+}
+
// static
void ChromeContentUtilityClient::PreSandboxStartup() {
#if BUILDFLAG(ENABLE_EXTENSIONS)

Powered by Google App Engine
This is Rietveld 408576698