OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_PRINTING_PDF_TO_EMF_CONVERTER_H_ | 5 #ifndef CHROME_BROWSER_PRINTING_PDF_TO_EMF_CONVERTER_H_ |
6 #define CHROME_BROWSER_PRINTING_PDF_TO_EMF_CONVERTER_H_ | 6 #define CHROME_BROWSER_PRINTING_PDF_TO_EMF_CONVERTER_H_ |
7 | 7 |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/memory/ref_counted_memory.h" | 9 #include "base/memory/ref_counted_memory.h" |
| 10 #include "base/memory/scoped_vector.h" |
10 | 11 |
11 namespace base { | 12 namespace base { |
12 class FilePath; | 13 class FilePath; |
13 } | 14 } |
14 | 15 |
15 namespace printing { | 16 namespace printing { |
16 class PdfRenderSettings; | 17 class PdfRenderSettings; |
17 } | 18 } |
18 | 19 |
19 namespace printing { | 20 namespace printing { |
20 | 21 |
| 22 class Metafile; |
| 23 |
21 class PdfToEmfConverter { | 24 class PdfToEmfConverter { |
22 public: | 25 public: |
23 // Callback for when the PDF is converted to an EMF. | 26 // Callback for when the PDF is converted to an EMF. |
24 typedef base::Callback<void(double /*scale_factor*/, | 27 // Takes ownership of metafiles. |
25 const std::vector<base::FilePath>& /*emf_files*/)> | 28 typedef base::Callback< |
| 29 void(double /*scale_factor*/, ScopedVector<Metafile>* /*emf_files*/)> |
26 ResultCallback; | 30 ResultCallback; |
27 virtual ~PdfToEmfConverter() {} | 31 virtual ~PdfToEmfConverter() {} |
28 | 32 |
29 static scoped_ptr<PdfToEmfConverter> CreateDefault(); | 33 static scoped_ptr<PdfToEmfConverter> CreateDefault(); |
30 | 34 |
31 virtual void Start(base::RefCountedMemory* data, | 35 virtual void Start(base::RefCountedMemory* data, |
32 const printing::PdfRenderSettings& conversion_settings, | 36 const printing::PdfRenderSettings& conversion_settings, |
33 const ResultCallback& callback) = 0; | 37 const ResultCallback& callback) = 0; |
34 }; | 38 }; |
35 | 39 |
36 } // namespace printing | 40 } // namespace printing |
37 | 41 |
38 #endif // CHROME_BROWSER_PRINTING_PDF_TO_EMF_CONVERTER_H_ | 42 #endif // CHROME_BROWSER_PRINTING_PDF_TO_EMF_CONVERTER_H_ |
OLD | NEW |