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

Unified Diff: printing/native_metafile_factory.h

Issue 6544028: Create a Factory for NativeMetafile. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed NativeMetafileFactory class comments 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/native_metafile_factory.h
diff --git a/printing/native_metafile_factory.h b/printing/native_metafile_factory.h
new file mode 100644
index 0000000000000000000000000000000000000000..b781b7c193d58830b476e991f88583d9b8682b6a
--- /dev/null
+++ b/printing/native_metafile_factory.h
@@ -0,0 +1,44 @@
+// 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.
+
+#ifndef PRINTING_NATIVE_METAFILE_FACTORY_H_
+#define PRINTING_NATIVE_METAFILE_FACTORY_H_
+
+#include "base/basictypes.h"
+#include "printing/native_metafile.h"
+
+#if defined(OS_WIN)
+ #include "printing/emf_win.h"
vandebo (ex-Chrome) 2011/02/23 02:01:41 indention.
dpapad 2011/02/24 20:56:59 Done.
+#elif defined(OS_MACOSX)
+ #include "printing/pdf_metafile_mac.h"
+#elif defined(OS_POSIX)
+ #include "printing/pdf_ps_metafile_cairo.h"
+#endif
+
+namespace printing {
+
+// Various printing contexts will be supported in the future (cairo, skia, emf).
+// So this class returns the appropriate context depending on the platform and
+// user preferences.
+// (Note: For the moment there is only one option per platform.)
+class NativeMetafileFactory {
+ public:
+
+ // This method takes care of returning a pointer to the appropriate
+ // NativeMetafile object according to the platform.
+ static printing::NativeMetafile* CreateMetafile();
+
+#if defined(OS_LINUX)
+ static printing::NativeMetafile*
+ CreateMetafileFrom(cairo_t* context);
+#endif
+
+ private:
+ NativeMetafileFactory();
+ DISALLOW_COPY_AND_ASSIGN(NativeMetafileFactory);
+};
+
+} // namespace printing
+
+#endif /* PRINTING_NATIVE_METAFILE_FACTORY_H_ */
vandebo (ex-Chrome) 2011/02/23 02:01:41 style.
dpapad 2011/02/24 20:56:59 Done.

Powered by Google App Engine
This is Rietveld 408576698