Index: printing/pdf_metafile_skia.cc |
diff --git a/printing/pdf_metafile_skia.cc b/printing/pdf_metafile_skia.cc |
index bb22792e40bd45e6fca8cfd90e2682a145ba321c..3558f334c266e06fc9136aeecc716ee4de0f95e8 100644 |
--- a/printing/pdf_metafile_skia.cc |
+++ b/printing/pdf_metafile_skia.cc |
@@ -10,6 +10,7 @@ |
#include "base/numerics/safe_conversions.h" |
#include "base/posix/eintr_wrapper.h" |
#include "base/time/time.h" |
+#include "printing/print_settings.h" |
#include "skia/ext/refptr.h" |
#include "third_party/skia/include/core/SkData.h" |
#include "third_party/skia/include/core/SkDocument.h" |
@@ -163,7 +164,10 @@ bool PdfMetafileSkia::FinishDocument() { |
pdf_doc->endPage(); |
} |
SkTArray<SkDocument::Attribute> info; |
- info.emplace_back(SkString("Creator"), SkString("Chromium")); |
+ const std::string& user_agent = GetAgent(); |
+ info.emplace_back(SkString("Creator"), |
+ user_agent.empty() ? SkString("Chromium") |
+ : SkString(user_agent.c_str(), user_agent.size())); |
Lei Zhang
2015/11/05 22:24:09
Can we do this in some way as suggested by the sty
hal.canary
2015/11/05 22:34:53
done
|
SkTime::DateTime now = TimeToSkTime(base::Time::Now()); |
pdf_doc->setMetadata(info, &now, &now); |
if (!pdf_doc->close()) |