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

Unified Diff: printing/metafile_factory.cc

Issue 6544028: Create a Factory for NativeMetafile. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed styling issues (naming, 80cols) Created 9 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 side-by-side diff with in-line comments
Download patch
Index: printing/metafile_factory.cc
diff --git a/printing/metafile_factory.cc b/printing/metafile_factory.cc
new file mode 100644
index 0000000000000000000000000000000000000000..c973acd17dce2962e4010c40d8507b4111718944
--- /dev/null
+++ b/printing/metafile_factory.cc
@@ -0,0 +1,33 @@
+/// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "printing/metafile_factory.h"
+
+namespace printing {
+
+/* static */
vandebo (ex-Chrome) 2011/02/22 22:18:16 // static
dpapad 2011/02/23 00:44:39 Done.
+printing::NativeMetafile* MetafileFactory::GetMetafile(){
+
+#if defined(OS_WIN)
vandebo (ex-Chrome) 2011/02/22 22:18:16 These can all be of the form: return new printing:
dpapad 2011/02/23 00:44:39 Done.
+ printing::NativeMetafile* metafile_ptr = new printing::Emf;
+#elif defined(OS_MACOSX)
+ printing::NativeMetafile* metafile_ptr = new printing::PdfMetafile;
+#elif defined(OS_POSIX)
+ printing::NativeMetafile* metafile_ptr = new printing::PdfPsMetafile;
+#endif
+
+ return metafile_ptr;
+
Avi (use Gerrit) 2011/02/22 19:00:07 unnecessary line
dpapad 2011/02/22 19:29:10 Done.
+}
+
+#if defined(OS_LINUX)
+/* static */
+printing::NativeMetafile* MetafileFactory::GetMetafileFrom(cairo_t* context){
+ printing::NativeMetafile* metafile_ptr =
+ printing::PdfPsMetafile::FromCairoContext(context);
+ return metafile_ptr;
+}
+#endif
+
+} // namespace printing

Powered by Google App Engine
This is Rietveld 408576698