summaryrefslogtreecommitdiffstats
path: root/printing
diff options
context:
space:
mode:
authordpapad@chromium.org <dpapad@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-19 01:04:57 +0000
committerdpapad@chromium.org <dpapad@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-19 01:04:57 +0000
commitcdd19f53d9ffe332e0324a69bffb3c4e9369e980 (patch)
tree5cddec581bbbd376d683ac717516029a96a6b85e /printing
parentf9722575da516bc5b88e5cbfb57b7c2782260429 (diff)
downloadchromium_src-cdd19f53d9ffe332e0324a69bffb3c4e9369e980.zip
chromium_src-cdd19f53d9ffe332e0324a69bffb3c4e9369e980.tar.gz
chromium_src-cdd19f53d9ffe332e0324a69bffb3c4e9369e980.tar.bz2
Renaming NativeMetafile related methods to more appropriate names.
1) Renaming Close() to FinishDocument() 2) Renaming NativeMetafileFactory::CreateMetafile() to Create(), since the name of the class already implies what is being created BUG=NONE TEST=NONE Review URL: http://codereview.chromium.org/6674037 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@78788 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'printing')
-rw-r--r--printing/emf_win.cc2
-rw-r--r--printing/emf_win.h2
-rw-r--r--printing/emf_win_unittest.cc6
-rw-r--r--printing/image.cc2
-rw-r--r--printing/native_metafile.h2
-rw-r--r--printing/native_metafile_factory.cc2
-rw-r--r--printing/native_metafile_factory.h2
-rw-r--r--printing/pdf_metafile_mac.cc2
-rw-r--r--printing/pdf_metafile_mac.h2
-rw-r--r--printing/pdf_metafile_mac_unittest.cc2
-rw-r--r--printing/pdf_ps_metafile_cairo.cc2
-rw-r--r--printing/pdf_ps_metafile_cairo.h2
-rw-r--r--printing/pdf_ps_metafile_cairo_unittest.cc4
13 files changed, 16 insertions, 16 deletions
diff --git a/printing/emf_win.cc b/printing/emf_win.cc
index 1b57add..de652f1 100644
--- a/printing/emf_win.cc
+++ b/printing/emf_win.cc
@@ -87,7 +87,7 @@ bool Emf::CreateFromFile(const FilePath& metafile_path) {
}
-bool Emf::Close() {
+bool Emf::FinishDocument() {
DCHECK(!emf_ && hdc_);
emf_ = CloseEnhMetaFile(hdc_);
DCHECK(emf_);
diff --git a/printing/emf_win.h b/printing/emf_win.h
index d1a5038..e3a0a8e 100644
--- a/printing/emf_win.h
+++ b/printing/emf_win.h
@@ -43,7 +43,7 @@ class Emf : public NativeMetafile {
const gfx::Point& content_origin,
const float& scale_factor);
virtual bool FinishPage();
- virtual bool Close();
+ virtual bool FinishDocument();
virtual uint32 GetDataSize() const;
virtual bool GetData(void* buffer, uint32 size) const;
diff --git a/printing/emf_win_unittest.cc b/printing/emf_win_unittest.cc
index a5bd583..9f2899b 100644
--- a/printing/emf_win_unittest.cc
+++ b/printing/emf_win_unittest.cc
@@ -52,7 +52,7 @@ TEST(EmfTest, DC) {
EXPECT_TRUE(emf.CreateDc(hdc, &rect));
EXPECT_TRUE(emf.context() != NULL);
// In theory, you'd use the HDC with GDI functions here.
- EXPECT_TRUE(emf.Close());
+ EXPECT_TRUE(emf.FinishDocument());
uint32 size = emf.GetDataSize();
EXPECT_EQ(size, EMF_HEADER_SIZE);
std::vector<BYTE> data;
@@ -138,7 +138,7 @@ TEST_F(EmfPrintingTest, PageBreak) {
EXPECT_TRUE(emf.FinishPage());
--pages;
}
- EXPECT_TRUE(emf.Close());
+ EXPECT_TRUE(emf.FinishDocument());
uint32 size = emf.GetDataSize();
std::vector<BYTE> data;
EXPECT_TRUE(emf.GetData(&data));
@@ -176,7 +176,7 @@ TEST(EmfTest, FileBackedDC) {
EXPECT_TRUE(emf.CreateFileBackedDc(hdc, &rect, metafile_path));
EXPECT_TRUE(emf.context() != NULL);
// In theory, you'd use the HDC with GDI functions here.
- EXPECT_TRUE(emf.Close());
+ EXPECT_TRUE(emf.FinishDocument());
uint32 size = emf.GetDataSize();
EXPECT_EQ(size, EMF_HEADER_SIZE);
diff --git a/printing/image.cc b/printing/image.cc
index 7c2d8d2..2f5d7e3 100644
--- a/printing/image.cc
+++ b/printing/image.cc
@@ -147,7 +147,7 @@ bool Image::LoadPng(const std::string& compressed) {
bool Image::LoadMetafile(const std::string& data) {
DCHECK(!data.empty());
scoped_ptr<NativeMetafile> metafile(
- printing::NativeMetafileFactory::CreateMetafile());
+ printing::NativeMetafileFactory::Create());
metafile->InitFromData(data.data(), data.size());
return LoadMetafile(*metafile);
}
diff --git a/printing/native_metafile.h b/printing/native_metafile.h
index 5981bf5..ef1e546 100644
--- a/printing/native_metafile.h
+++ b/printing/native_metafile.h
@@ -64,7 +64,7 @@ class NativeMetafile {
// Closes the metafile. No further rendering is allowed (the current page
// is implicitly closed).
- virtual bool Close() = 0;
+ virtual bool FinishDocument() = 0;
// Returns the size of the underlying data stream. Only valid after Close()
// has been called.
diff --git a/printing/native_metafile_factory.cc b/printing/native_metafile_factory.cc
index a41428f..f971452 100644
--- a/printing/native_metafile_factory.cc
+++ b/printing/native_metafile_factory.cc
@@ -15,7 +15,7 @@
namespace printing {
// static
-printing::NativeMetafile* NativeMetafileFactory::CreateMetafile() {
+printing::NativeMetafile* NativeMetafileFactory::Create() {
#if defined(OS_WIN)
return new printing::Emf;
#elif defined(OS_MACOSX)
diff --git a/printing/native_metafile_factory.h b/printing/native_metafile_factory.h
index d1543c7..b13f17a 100644
--- a/printing/native_metafile_factory.h
+++ b/printing/native_metafile_factory.h
@@ -18,7 +18,7 @@ class NativeMetafileFactory {
public:
// This method returns a pointer to the appropriate NativeMetafile object
// according to the platform.
- static printing::NativeMetafile* CreateMetafile();
+ static printing::NativeMetafile* Create();
private:
NativeMetafileFactory();
diff --git a/printing/pdf_metafile_mac.cc b/printing/pdf_metafile_mac.cc
index 031ca21..f5a36f8 100644
--- a/printing/pdf_metafile_mac.cc
+++ b/printing/pdf_metafile_mac.cc
@@ -96,7 +96,7 @@ bool PdfMetafile::FinishPage() {
return true;
}
-bool PdfMetafile::Close() {
+bool PdfMetafile::FinishDocument() {
DCHECK(context_.get());
DCHECK(!page_is_open_);
diff --git a/printing/pdf_metafile_mac.h b/printing/pdf_metafile_mac.h
index 6641062..c5a2a4a 100644
--- a/printing/pdf_metafile_mac.h
+++ b/printing/pdf_metafile_mac.h
@@ -37,7 +37,7 @@ class PdfMetafile : public NativeMetafile {
const gfx::Point& content_origin,
const float& scale_factor);
virtual bool FinishPage();
- virtual bool Close();
+ virtual bool FinishDocument();
virtual uint32 GetDataSize() const;
virtual bool GetData(void* dst_buffer, uint32 dst_buffer_size) const;
diff --git a/printing/pdf_metafile_mac_unittest.cc b/printing/pdf_metafile_mac_unittest.cc
index b4b6996..b237978 100644
--- a/printing/pdf_metafile_mac_unittest.cc
+++ b/printing/pdf_metafile_mac_unittest.cc
@@ -32,7 +32,7 @@ TEST(PdfMetafileTest, Pdf) {
pdf.StartPage(size_2, origin_2, 2.0);
pdf.FinishPage();
- pdf.Close();
+ pdf.FinishDocument();
// Check data size.
uint32 size = pdf.GetDataSize();
diff --git a/printing/pdf_ps_metafile_cairo.cc b/printing/pdf_ps_metafile_cairo.cc
index 32d882f..6c42bd4 100644
--- a/printing/pdf_ps_metafile_cairo.cc
+++ b/printing/pdf_ps_metafile_cairo.cc
@@ -176,7 +176,7 @@ bool PdfPsMetafile::FinishPage() {
return true;
}
-bool PdfPsMetafile::Close() {
+bool PdfPsMetafile::FinishDocument() {
DCHECK(IsSurfaceValid(surface_));
DCHECK(IsContextValid(context_));
diff --git a/printing/pdf_ps_metafile_cairo.h b/printing/pdf_ps_metafile_cairo.h
index d3d3824..5ff59db 100644
--- a/printing/pdf_ps_metafile_cairo.h
+++ b/printing/pdf_ps_metafile_cairo.h
@@ -35,7 +35,7 @@ class PdfPsMetafile : public NativeMetafile {
const gfx::Point& content_origin,
const float& scale_factor);
virtual bool FinishPage();
- virtual bool Close();
+ virtual bool FinishDocument();
virtual uint32 GetDataSize() const;
virtual bool GetData(void* dst_buffer, uint32 dst_buffer_size) const;
diff --git a/printing/pdf_ps_metafile_cairo_unittest.cc b/printing/pdf_ps_metafile_cairo_unittest.cc
index d4f2090..fa1a239 100644
--- a/printing/pdf_ps_metafile_cairo_unittest.cc
+++ b/printing/pdf_ps_metafile_cairo_unittest.cc
@@ -43,7 +43,7 @@ TEST_F(PdfPsTest, Pdf) {
EXPECT_TRUE(pdf.FinishPage());
// Closes the file.
- pdf.Close();
+ pdf.FinishDocument();
// Checks data size.
uint32 size = pdf.GetDataSize();
@@ -75,7 +75,7 @@ TEST_F(PdfPsTest, Pdf) {
std::string test_raw_data = "Dummy PDF";
EXPECT_TRUE(pdf3.SetRawData(test_raw_data.c_str(), test_raw_data.size()));
EXPECT_TRUE(pdf3.FinishPage());
- pdf3.Close();
+ pdf3.FinishDocument();
size = pdf3.GetDataSize();
EXPECT_EQ(test_raw_data.size(), size);
std::string output;