summaryrefslogtreecommitdiffstats
path: root/printing
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-17 04:09:06 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-17 04:09:06 +0000
commitdf0ca6c858762b101bf424ff6c0522409fa195fc (patch)
treeefa188eee6972e2c0de358f2d19a2348ce6dcb06 /printing
parent73de26a684944782a92f8e6840e1b290c9a424cd (diff)
downloadchromium_src-df0ca6c858762b101bf424ff6c0522409fa195fc.zip
chromium_src-df0ca6c858762b101bf424ff6c0522409fa195fc.tar.gz
chromium_src-df0ca6c858762b101bf424ff6c0522409fa195fc.tar.bz2
Move scoped_cftyperef from base to base/mac, use the new namespace, and name it
properly (scoped_cftyperef -> ScopedCFTypeRef). TEST=it compiles BUG=none Review URL: http://codereview.chromium.org/3855001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@62887 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'printing')
-rw-r--r--printing/image.cc6
-rw-r--r--printing/pdf_metafile_mac.cc10
-rw-r--r--printing/pdf_metafile_mac.h8
-rw-r--r--printing/printed_document_mac.cc1
-rw-r--r--printing/printing_context_mac.mm4
5 files changed, 15 insertions, 14 deletions
diff --git a/printing/image.cc b/printing/image.cc
index 51b5ea7..27822cf 100644
--- a/printing/image.cc
+++ b/printing/image.cc
@@ -15,7 +15,7 @@
#include "gfx/gdi_util.h" // EMF support
#elif defined(OS_MACOSX)
#include <ApplicationServices/ApplicationServices.h>
-#include "base/scoped_cftyperef.h"
+#include "base/mac/scoped_cftyperef.h"
#endif
namespace {
@@ -243,9 +243,9 @@ bool Image::LoadMetafile(const NativeMetafile& metafile) {
size_t bytes = row_length_ * size_.height();
DCHECK(bytes);
data_.resize(bytes);
- scoped_cftyperef<CGColorSpaceRef> color_space(
+ base::mac::ScopedCFTypeRef<CGColorSpaceRef> color_space(
CGColorSpaceCreateWithName(kCGColorSpaceGenericRGB));
- scoped_cftyperef<CGContextRef> bitmap_context(
+ base::mac::ScopedCFTypeRef<CGContextRef> bitmap_context(
CGBitmapContextCreate(&*data_.begin(), size_.width(), size_.height(),
8, row_length_, color_space,
kCGImageAlphaPremultipliedLast));
diff --git a/printing/pdf_metafile_mac.cc b/printing/pdf_metafile_mac.cc
index 9520369..d09721f 100644
--- a/printing/pdf_metafile_mac.cc
+++ b/printing/pdf_metafile_mac.cc
@@ -6,10 +6,12 @@
#include "base/file_path.h"
#include "base/logging.h"
-#include "base/scoped_cftyperef.h"
+#include "base/mac/scoped_cftyperef.h"
#include "base/sys_string_conversions.h"
#include "gfx/rect.h"
+using base::mac::ScopedCFTypeRef;
+
namespace printing {
PdfMetafile::PdfMetafile()
@@ -26,7 +28,7 @@ CGContextRef PdfMetafile::Init() {
LOG(ERROR) << "Failed to create pdf data for metafile";
return NULL;
}
- scoped_cftyperef<CGDataConsumerRef> pdf_consumer(
+ ScopedCFTypeRef<CGDataConsumerRef> pdf_consumer(
CGDataConsumerCreateWithCFData(pdf_data_));
if (!pdf_consumer.get()) {
LOG(ERROR) << "Failed to create data consumer for metafile";
@@ -202,7 +204,7 @@ bool PdfMetafile::SaveTo(const FilePath& file_path) const {
DCHECK(!context_.get());
std::string path_string = file_path.value();
- scoped_cftyperef<CFURLRef> path_url(CFURLCreateFromFileSystemRepresentation(
+ ScopedCFTypeRef<CFURLRef> path_url(CFURLCreateFromFileSystemRepresentation(
kCFAllocatorDefault, reinterpret_cast<const UInt8*>(path_string.c_str()),
path_string.length(), false));
SInt32 error_code;
@@ -216,7 +218,7 @@ CGPDFDocumentRef PdfMetafile::GetPDFDocument() const {
DCHECK(!context_.get());
if (!pdf_doc_.get()) {
- scoped_cftyperef<CGDataProviderRef> pdf_data_provider(
+ ScopedCFTypeRef<CGDataProviderRef> pdf_data_provider(
CGDataProviderCreateWithCFData(pdf_data_));
pdf_doc_.reset(CGPDFDocumentCreateWithProvider(pdf_data_provider));
}
diff --git a/printing/pdf_metafile_mac.h b/printing/pdf_metafile_mac.h
index 0a0ea3c..8872d99 100644
--- a/printing/pdf_metafile_mac.h
+++ b/printing/pdf_metafile_mac.h
@@ -9,7 +9,7 @@
#include <CoreFoundation/CoreFoundation.h>
#include "base/basictypes.h"
-#include "base/scoped_cftyperef.h"
+#include "base/mac/scoped_cftyperef.h"
namespace gfx {
class Rect;
@@ -90,13 +90,13 @@ class PdfMetafile {
CGPDFDocumentRef GetPDFDocument() const;
// Context for rendering to the pdf.
- scoped_cftyperef<CGContextRef> context_;
+ base::mac::ScopedCFTypeRef<CGContextRef> context_;
// PDF backing store.
- scoped_cftyperef<CFMutableDataRef> pdf_data_;
+ base::mac::ScopedCFTypeRef<CFMutableDataRef> pdf_data_;
// Lazily-created CGPDFDocument representation of pdf_data_.
- mutable scoped_cftyperef<CGPDFDocumentRef> pdf_doc_;
+ mutable base::mac::ScopedCFTypeRef<CGPDFDocumentRef> pdf_doc_;
// Whether or not a page is currently open.
bool page_is_open_;
diff --git a/printing/printed_document_mac.cc b/printing/printed_document_mac.cc
index 8ba8b813..d429109 100644
--- a/printing/printed_document_mac.cc
+++ b/printing/printed_document_mac.cc
@@ -8,7 +8,6 @@
#import <CoreFoundation/CoreFoundation.h>
#include "base/logging.h"
-#include "base/scoped_cftyperef.h"
#include "printing/page_number.h"
#include "printing/printed_page.h"
diff --git a/printing/printing_context_mac.mm b/printing/printing_context_mac.mm
index 50431ae6..a0ca19a 100644
--- a/printing/printing_context_mac.mm
+++ b/printing/printing_context_mac.mm
@@ -8,7 +8,7 @@
#import <AppKit/AppKit.h>
#include "base/logging.h"
-#include "base/scoped_cftyperef.h"
+#include "base/mac/scoped_cftyperef.h"
#include "base/sys_string_conversions.h"
namespace printing {
@@ -123,7 +123,7 @@ PrintingContext::Result PrintingContextMac::NewDocument(
PMPageFormat page_format =
static_cast<PMPageFormat>([print_info_ PMPageFormat]);
- scoped_cftyperef<CFStringRef> job_title(
+ base::mac::ScopedCFTypeRef<CFStringRef> job_title(
base::SysUTF16ToCFStringRef(document_name));
PMPrintSettingsSetJobName(print_settings, job_title.get());