Adding CreateFromData to NativeMetafileFactory

Also making Create method calling Init on the metafile before returning it.
Usually clients of the NativeMetafileFactory call Create and the Init or
InitFromData on the object to initialize it. Now the returned object will
already be initialized.

BUG=NONE
TEST=NONE

Review URL: http://codereview.chromium.org/6696076

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@79475 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/printing/image.cc b/printing/image.cc
index 2f5d7e3..87a6f7e3 100644
--- a/printing/image.cc
+++ b/printing/image.cc
@@ -147,8 +147,10 @@
 bool Image::LoadMetafile(const std::string& data) {
   DCHECK(!data.empty());
   scoped_ptr<NativeMetafile> metafile(
-      printing::NativeMetafileFactory::Create());
-  metafile->InitFromData(data.data(), data.size());
+      printing::NativeMetafileFactory::CreateFromData(data.data(),
+                                                      data.size()));
+  if(!metafile.get())
+    return false;
   return LoadMetafile(*metafile);
 }