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

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, 8 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..62e9fde74aa2abce035630b46930db40b507c8d6
--- /dev/null
+++ b/components/printing/service/public/cpp/pdf_compositor_service_factory.cc
@@ -0,0 +1,24 @@
+// 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/common/content_client.h"
Lei Zhang 2017/05/04 02:13:13 No needed.
Wei Li 2017/05/04 18:18:28 Done.
+#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