summaryrefslogtreecommitdiffstats
path: root/printing
diff options
context:
space:
mode:
Diffstat (limited to 'printing')
-rw-r--r--printing/emf_win.h2
-rw-r--r--printing/metafile.h5
-rw-r--r--printing/pdf_metafile_cairo_linux.h2
-rw-r--r--printing/pdf_metafile_cg_mac.h2
-rw-r--r--printing/pdf_metafile_skia.cc7
-rw-r--r--printing/pdf_metafile_skia.h6
-rw-r--r--printing/print_job_constants.cc3
-rw-r--r--printing/print_job_constants.h1
8 files changed, 27 insertions, 1 deletions
diff --git a/printing/emf_win.h b/printing/emf_win.h
index f7e0ed5..7b8dab6 100644
--- a/printing/emf_win.h
+++ b/printing/emf_win.h
@@ -84,6 +84,8 @@ class Emf : public Metafile {
return emf_;
}
+ virtual void set_draft(bool /* draft */) const {}
+
private:
FRIEND_TEST_ALL_PREFIXES(EmfTest, DC);
FRIEND_TEST_ALL_PREFIXES(EmfPrintingTest, PageBreak);
diff --git a/printing/metafile.h b/printing/metafile.h
index 84c0556..2ec1d78 100644
--- a/printing/metafile.h
+++ b/printing/metafile.h
@@ -143,6 +143,11 @@ class Metafile {
// Returns true if writing succeeded.
virtual bool SaveToFD(const base::FileDescriptor& fd) const = 0;
#endif // if defined(OS_CHROMEOS)
+
+ // Sets the flag to create a draft metafile.
+ // NOTE: Draft metafile does not include font embedding, compression, etc.
+ // This is currently used only in print preview workflow.
+ virtual void set_draft(bool draft) const = 0;
};
} // namespace printing
diff --git a/printing/pdf_metafile_cairo_linux.h b/printing/pdf_metafile_cairo_linux.h
index 6f07ae0..7919980 100644
--- a/printing/pdf_metafile_cairo_linux.h
+++ b/printing/pdf_metafile_cairo_linux.h
@@ -60,6 +60,8 @@ class PdfMetafileCairo : public Metafile {
virtual bool SaveToFD(const base::FileDescriptor& fd) const;
#endif // if defined(OS_CHROMEOS)
+ virtual void set_draft(bool /* draft */) const {}
+
private:
// Cleans up all resources.
void CleanUpAll();
diff --git a/printing/pdf_metafile_cg_mac.h b/printing/pdf_metafile_cg_mac.h
index 5a7f56d..303cfd5 100644
--- a/printing/pdf_metafile_cg_mac.h
+++ b/printing/pdf_metafile_cg_mac.h
@@ -65,6 +65,8 @@ class PdfMetafileCg : public Metafile, public base::ThreadChecker {
bool center_horizontally,
bool center_vertically) const;
+ virtual void set_draft(bool /* draft */) const {}
+
private:
// Returns a CGPDFDocumentRef version of pdf_data_.
CGPDFDocumentRef GetPDFDocument() const;
diff --git a/printing/pdf_metafile_skia.cc b/printing/pdf_metafile_skia.cc
index beda36f..bcb5af93 100644
--- a/printing/pdf_metafile_skia.cc
+++ b/printing/pdf_metafile_skia.cc
@@ -195,6 +195,11 @@ bool PdfMetafileSkia::SaveToFD(const base::FileDescriptor& fd) const {
}
#endif
-PdfMetafileSkia::PdfMetafileSkia() : data_(new PdfMetafileSkiaData) {}
+PdfMetafileSkia::PdfMetafileSkia()
+ : data_(new PdfMetafileSkiaData),
+ draft_(false) {}
+void PdfMetafileSkia::set_draft(bool draft) const {
+ draft_ = draft;
+}
} // namespace printing
diff --git a/printing/pdf_metafile_skia.h b/printing/pdf_metafile_skia.h
index 0ad2afb..3d1c7bd 100644
--- a/printing/pdf_metafile_skia.h
+++ b/printing/pdf_metafile_skia.h
@@ -59,9 +59,15 @@ class PdfMetafileSkia : public Metafile {
#if defined(OS_CHROMEOS)
virtual bool SaveToFD(const base::FileDescriptor& fd) const;
#endif // if defined(OS_CHROMEOS)
+
+ virtual void set_draft(bool draft) const;
+
private:
scoped_ptr<PdfMetafileSkiaData> data_;
+ // True when a draft version of metafile is requested.
+ mutable bool draft_;
+
DISALLOW_COPY_AND_ASSIGN(PdfMetafileSkia);
};
diff --git a/printing/print_job_constants.cc b/printing/print_job_constants.cc
index d8eb0ce..5f72252 100644
--- a/printing/print_job_constants.cc
+++ b/printing/print_job_constants.cc
@@ -39,4 +39,7 @@ const char kSettingPrinterName[] = "printerName";
// Print to PDF option: true if selected, false if not.
const char kSettingPrintToPDF[] = "printToPDF";
+// True when draft preview document is required.
+const char kSettingDraftDocument[] = "draftDocument";
+
} // namespace printing
diff --git a/printing/print_job_constants.h b/printing/print_job_constants.h
index 0f43b7f..8ee5e7f 100644
--- a/printing/print_job_constants.h
+++ b/printing/print_job_constants.h
@@ -11,6 +11,7 @@ extern const char kSettingCollate[];
extern const char kSettingColor[];
extern const char kSettingCopies[];
extern const char kSettingDeviceName[];
+extern const char kSettingDraftDocument[];
extern const char kSettingDuplexMode[];
extern const char kSettingLandscape[];
extern const char kSettingPageRange[];