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

Unified Diff: chrome/browser/printing/pdf_to_emf_converter.h

Issue 2633573002: Add Postscript Printing (Closed)
Patch Set: Fix Linux compile error Created 3 years, 11 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: chrome/browser/printing/pdf_to_emf_converter.h
diff --git a/chrome/browser/printing/pdf_to_emf_converter.h b/chrome/browser/printing/pdf_to_emf_converter.h
index 1f52715274065a1103add15ec17b951b81727caa..4a3ab644ef8d9268e6d9ae4c8dbc70ec10276b74 100644
--- a/chrome/browser/printing/pdf_to_emf_converter.h
+++ b/chrome/browser/printing/pdf_to_emf_converter.h
@@ -17,11 +17,11 @@ struct PdfRenderSettings;
class PdfToEmfConverter {
public:
Vitaly Buka (NO REVIEWS) 2017/01/17 19:29:16 I'd recommend to submit patches as small as possib
- typedef base::Callback<void(int page_count)> StartCallback;
- typedef base::Callback<void(int page_number,
- float scale_factor,
- std::unique_ptr<MetafilePlayer> emf)>
- GetPageCallback;
+ using StartCallback = base::Callback<void(int page_count)>;
+ using GetPageCallback =
+ base::Callback<void(int page_number,
+ float scale_factor,
+ std::unique_ptr<MetafilePlayer> emf)>;
virtual ~PdfToEmfConverter();
@@ -31,7 +31,31 @@ class PdfToEmfConverter {
// with positive |page_count|. |page_count| is 0 if initialization failed.
virtual void Start(const scoped_refptr<base::RefCountedMemory>& data,
const PdfRenderSettings& conversion_settings,
- bool print_text_with_gdi,
+ const StartCallback& start_callback) = 0;
+
+ // Requests conversion of the page. |page_number| is 0-base page number in
+ // PDF provided in Start() call.
+ // Calls |get_page_callback| after conversion. |emf| of callback in not NULL
+ // if conversion succeeded.
+ virtual void GetPage(int page_number,
+ const GetPageCallback& get_page_callback) = 0;
+};
+
+class PdfToPostScriptConverter {
Vitaly Buka (NO REVIEWS) 2017/01/17 19:29:16 why not separate pair of h/cc file git probably wo
+ public:
+ using StartCallback = base::Callback<void(int page_count)>;
+ using GetPageCallback =
+ base::Callback<void(int page_number,
+ std::unique_ptr<MetafilePlayer> ps_metafile)>;
+
+ virtual ~PdfToPostScriptConverter();
+
+ static std::unique_ptr<PdfToPostScriptConverter> CreateDefault();
+
+ // Starts conversion of PDF provided as |data|. Calls |start_callback|
+ // with positive |page_count|. |page_count| is 0 if initialization failed.
+ virtual void Start(const scoped_refptr<base::RefCountedMemory>& data,
+ const PdfRenderSettings& conversion_settings,
const StartCallback& start_callback) = 0;
// Requests conversion of the page. |page_number| is 0-base page number in

Powered by Google App Engine
This is Rietveld 408576698