Index: printing/pdf_metafile_skia.cc |
diff --git a/printing/pdf_metafile_skia.cc b/printing/pdf_metafile_skia.cc |
index 4e154845a55aaad2ecb659474e282a860e07a2f7..2e3b07b2c3c6b78c01ef787477d1073019038e59 100644 |
--- a/printing/pdf_metafile_skia.cc |
+++ b/printing/pdf_metafile_skia.cc |
@@ -16,7 +16,6 @@ |
#include "cc/paint/paint_recorder.h" |
#include "cc/paint/skia_paint_canvas.h" |
#include "printing/print_settings.h" |
-#include "third_party/skia/include/core/SkDocument.h" |
#include "third_party/skia/include/core/SkStream.h" |
// Note that headers in third_party/skia/src are fragile. This is |
// an experimental, fragile, and diagnostic-only document type. |
@@ -45,35 +44,6 @@ bool WriteAssetToBuffer(const SkStreamAsset* asset, |
return (length == assetCopy->read(buffer, length)); |
} |
-SkTime::DateTime TimeToSkTime(base::Time time) { |
- base::Time::Exploded exploded; |
- time.UTCExplode(&exploded); |
- SkTime::DateTime skdate; |
- skdate.fTimeZoneMinutes = 0; |
- skdate.fYear = exploded.year; |
- skdate.fMonth = exploded.month; |
- skdate.fDayOfWeek = exploded.day_of_week; |
- skdate.fDay = exploded.day_of_month; |
- skdate.fHour = exploded.hour; |
- skdate.fMinute = exploded.minute; |
- skdate.fSecond = exploded.second; |
- return skdate; |
-} |
- |
-sk_sp<SkDocument> MakePdfDocument(SkWStream* wStream) { |
- SkDocument::PDFMetadata metadata; |
- SkTime::DateTime now = TimeToSkTime(base::Time::Now()); |
- metadata.fCreation.fEnabled = true; |
- metadata.fCreation.fDateTime = now; |
- metadata.fModified.fEnabled = true; |
- metadata.fModified.fDateTime = now; |
- const std::string& agent = printing::GetAgent(); |
- metadata.fCreator = agent.empty() ? SkString("Chromium") |
- : SkString(agent.c_str(), agent.size()); |
- return SkDocument::MakePDF(wStream, SK_ScalarDefaultRasterDPI, metadata, |
- nullptr, false); |
-} |
- |
} // namespace |
namespace printing { |
@@ -192,7 +162,7 @@ bool PdfMetafileSkia::FinishDocument() { |
sk_sp<SkDocument> doc; |
switch (data_->type_) { |
case PDF_SKIA_DOCUMENT_TYPE: |
- doc = MakePdfDocument(&stream); |
+ doc = MakePdfDocument(printing::GetAgent(), &stream); |
break; |
case MSKP_SKIA_DOCUMENT_TYPE: |
doc = SkMakeMultiPictureDocument(&stream); |