Chromium Code Reviews| 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 |