summaryrefslogtreecommitdiffstats
path: root/printing/image.cc
diff options
context:
space:
mode:
authorvandebo@chromium.org <vandebo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-11 21:54:06 +0000
committervandebo@chromium.org <vandebo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-11 21:54:06 +0000
commit7d748990b39550c77aa914ba6846885dd7352e10 (patch)
tree3777582ee9816b3488f218b594db1918e5ebe752 /printing/image.cc
parent03e204f307255e8f39aeb002f94b8eb04137e7f9 (diff)
downloadchromium_src-7d748990b39550c77aa914ba6846885dd7352e10.zip
chromium_src-7d748990b39550c77aa914ba6846885dd7352e10.tar.gz
chromium_src-7d748990b39550c77aa914ba6846885dd7352e10.tar.bz2
Connect the right metafiles for print preview on Linux and Windows.
+ Remove the NativeMetafileFactory since we can't just use preview flag. + Update each Metafile constructor site to use PreviewMetafile or NativeMetafileImpl. + Fix misc. problems blocking pdf generation on Windows. + Rename the metafile interface. BUG=NONE TEST=NONE Review URL: http://codereview.chromium.org/6826027 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@81161 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'printing/image.cc')
-rw-r--r--printing/image.cc14
1 files changed, 6 insertions, 8 deletions
diff --git a/printing/image.cc b/printing/image.cc
index a7ae67d..062ac89 100644
--- a/printing/image.cc
+++ b/printing/image.cc
@@ -6,9 +6,9 @@
#include "base/file_util.h"
#include "base/md5.h"
-#include "base/memory/scoped_ptr.h"
#include "base/string_number_conversions.h"
-#include "printing/native_metafile_factory.h"
+#include "printing/metafile.h"
+#include "printing/metafile_impl.h"
#include "third_party/skia/include/core/SkColor.h"
#include "ui/gfx/codec/png_codec.h"
@@ -34,7 +34,7 @@ Image::Image(const FilePath& path)
}
}
-Image::Image(const NativeMetafile& metafile)
+Image::Image(const Metafile& metafile)
: row_length_(0),
ignore_alpha_(true) {
LoadMetafile(metafile);
@@ -146,12 +146,10 @@ bool Image::LoadPng(const std::string& compressed) {
bool Image::LoadMetafile(const std::string& data) {
DCHECK(!data.empty());
- scoped_ptr<NativeMetafile> metafile(
- printing::NativeMetafileFactory::CreateFromData(data.data(),
- data.size()));
- if(!metafile.get())
+ printing::NativeMetafile metafile;
+ if (!metafile.InitFromData(data.data(), data.size()))
return false;
- return LoadMetafile(*metafile);
+ return LoadMetafile(metafile);
}
} // namespace printing