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

Side by Side Diff: printing/pdf_metafile_cg_mac.cc

Issue 12217101: Replace FilePath with base::FilePath in some more top level directories. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « printing/image.cc ('k') | printing/pdf_metafile_skia.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_cg_mac.h" 5 #include "printing/pdf_metafile_cg_mac.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/file_path.h" 9 #include "base/file_path.h"
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 uint32 data_size = GetDataSize(); 279 uint32 data_size = GetDataSize();
280 if (dst_buffer_size > data_size) { 280 if (dst_buffer_size > data_size) {
281 return false; 281 return false;
282 } 282 }
283 283
284 CFDataGetBytes(pdf_data_, CFRangeMake(0, dst_buffer_size), 284 CFDataGetBytes(pdf_data_, CFRangeMake(0, dst_buffer_size),
285 static_cast<UInt8*>(dst_buffer)); 285 static_cast<UInt8*>(dst_buffer));
286 return true; 286 return true;
287 } 287 }
288 288
289 bool PdfMetafileCg::SaveTo(const FilePath& file_path) const { 289 bool PdfMetafileCg::SaveTo(const base::FilePath& file_path) const {
290 DCHECK(pdf_data_.get()); 290 DCHECK(pdf_data_.get());
291 DCHECK(!context_.get()); 291 DCHECK(!context_.get());
292 292
293 std::string path_string = file_path.value(); 293 std::string path_string = file_path.value();
294 ScopedCFTypeRef<CFURLRef> path_url(CFURLCreateFromFileSystemRepresentation( 294 ScopedCFTypeRef<CFURLRef> path_url(CFURLCreateFromFileSystemRepresentation(
295 kCFAllocatorDefault, reinterpret_cast<const UInt8*>(path_string.c_str()), 295 kCFAllocatorDefault, reinterpret_cast<const UInt8*>(path_string.c_str()),
296 path_string.length(), false)); 296 path_string.length(), false));
297 SInt32 error_code; 297 SInt32 error_code;
298 CFURLWriteDataAndPropertiesToResource(path_url, pdf_data_, NULL, &error_code); 298 CFURLWriteDataAndPropertiesToResource(path_url, pdf_data_, NULL, &error_code);
299 return error_code == 0; 299 return error_code == 0;
(...skipping 10 matching lines...) Expand all
310 310
311 if (!pdf_doc_.get()) { 311 if (!pdf_doc_.get()) {
312 ScopedCFTypeRef<CGDataProviderRef> pdf_data_provider( 312 ScopedCFTypeRef<CGDataProviderRef> pdf_data_provider(
313 CGDataProviderCreateWithCFData(pdf_data_)); 313 CGDataProviderCreateWithCFData(pdf_data_));
314 pdf_doc_.reset(CGPDFDocumentCreateWithProvider(pdf_data_provider)); 314 pdf_doc_.reset(CGPDFDocumentCreateWithProvider(pdf_data_provider));
315 } 315 }
316 return pdf_doc_.get(); 316 return pdf_doc_.get();
317 } 317 }
318 318
319 } // namespace printing 319 } // namespace printing
OLDNEW
« no previous file with comments | « printing/image.cc ('k') | printing/pdf_metafile_skia.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698