OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 #include "printing/pdf_metafile_mac.h" | 5 #include "printing/pdf_metafile_mac.h" |
6 | 6 |
7 #include "base/file_path.h" | 7 #include "base/file_path.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/scoped_cftyperef.h" | 9 #include "base/mac/scoped_cftyperef.h" |
10 #include "base/sys_string_conversions.h" | 10 #include "base/sys_string_conversions.h" |
11 #include "gfx/rect.h" | 11 #include "gfx/rect.h" |
12 | 12 |
| 13 using base::mac::ScopedCFTypeRef; |
| 14 |
13 namespace printing { | 15 namespace printing { |
14 | 16 |
15 PdfMetafile::PdfMetafile() | 17 PdfMetafile::PdfMetafile() |
16 : page_is_open_(false) { | 18 : page_is_open_(false) { |
17 } | 19 } |
18 | 20 |
19 CGContextRef PdfMetafile::Init() { | 21 CGContextRef PdfMetafile::Init() { |
20 // Ensure that Init hasn't already been called. | 22 // Ensure that Init hasn't already been called. |
21 DCHECK(!context_.get()); | 23 DCHECK(!context_.get()); |
22 DCHECK(!pdf_data_.get()); | 24 DCHECK(!pdf_data_.get()); |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 | 219 |
218 if (!pdf_doc_.get()) { | 220 if (!pdf_doc_.get()) { |
219 scoped_cftyperef<CGDataProviderRef> pdf_data_provider( | 221 scoped_cftyperef<CGDataProviderRef> pdf_data_provider( |
220 CGDataProviderCreateWithCFData(pdf_data_)); | 222 CGDataProviderCreateWithCFData(pdf_data_)); |
221 pdf_doc_.reset(CGPDFDocumentCreateWithProvider(pdf_data_provider)); | 223 pdf_doc_.reset(CGPDFDocumentCreateWithProvider(pdf_data_provider)); |
222 } | 224 } |
223 return pdf_doc_.get(); | 225 return pdf_doc_.get(); |
224 } | 226 } |
225 | 227 |
226 } // namespace printing | 228 } // namespace printing |
OLD | NEW |