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

Unified Diff: components/printing/service/public/cpp/pdf_compositor_service_factory.cc

Issue 2832633002: Add PDF compositor service (Closed)
Patch Set: rebase 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: components/printing/service/public/cpp/pdf_compositor_service_factory.cc
diff --git a/components/printing/service/public/cpp/pdf_compositor_service_factory.cc b/components/printing/service/public/cpp/pdf_compositor_service_factory.cc
new file mode 100644
index 0000000000000000000000000000000000000000..f832f86031338bdf62fbafbde5742688c2f867c9
--- /dev/null
+++ b/components/printing/service/public/cpp/pdf_compositor_service_factory.cc
@@ -0,0 +1,23 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "components/printing/service/public/cpp/pdf_compositor_service_factory.h"
+
+#include "components/printing/service/pdf_compositor_service.h"
+#include "content/public/utility/utility_thread.h"
+#include "third_party/WebKit/public/platform/WebImageGenerator.h"
+#include "third_party/skia/include/core/SkGraphics.h"
+
+namespace printing {
+
+std::unique_ptr<service_manager::Service> CreatePdfCompositorService(
+ const std::string& creator) {
+ content::UtilityThread::Get()->EnsureBlinkInitialized();
+ // Hook up blink's codecs so skia can call them.
+ SkGraphics::SetImageGeneratorFromEncodedDataFactory(
+ blink::WebImageGenerator::Create);
+ return printing::PdfCompositorService::Create(creator);
+}
+
+} // namespace printing

Powered by Google App Engine
This is Rietveld 408576698