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

Unified Diff: printing/metafile_factory.h

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.h
diff --git a/printing/metafile_factory.h b/printing/metafile_factory.h
new file mode 100644
index 0000000000000000000000000000000000000000..5e80cc85b7cad7c74f18bac473d583734aba92bf
--- /dev/null
+++ b/printing/metafile_factory.h
@@ -0,0 +1,43 @@
+// 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 METAFILE_FACTORY_H_
vandebo (ex-Chrome) 2011/02/22 22:18:16 PRINTING_NATIVE_METAFILE_FACTORY_H_
dpapad 2011/02/23 00:44:39 Done.
+#define METAFILE_FACTORY_H_
+
+#include "base/basictypes.h"
+#include "printing/native_metafile.h"
+
+#if defined(OS_WIN)
+ #include "printing/emf_win.h"
+#elif defined(OS_MACOSX)
+ #include "printing/pdf_metafile_mac.h"
+#elif defined(OS_POSIX)
+ #include "printing/pdf_ps_metafile_cairo.h"
+#endif
+
+namespace printing {
+
+// This class is used to obtain pointers to NativeMetafile objects. It is the
vandebo (ex-Chrome) 2011/02/22 22:18:16 This comment can be improved; most readers will un
dpapad 2011/02/23 00:44:39 Done.
+// only way to initialize such objects since their constructors are private.
+class MetafileFactory {
vandebo (ex-Chrome) 2011/02/22 22:18:16 NativeMetafileFactory
dpapad 2011/02/23 00:44:39 Done.
+ public:
+ virtual ~MetafileFactory();
vandebo (ex-Chrome) 2011/02/22 22:18:16 Not necessary, as there is currently no way to cre
dpapad 2011/02/23 00:44:39 Done.
+
+ // This method takes care of returning a pointer to the appropriate
+ // NativeMetafile object according to the platform.
+ static printing::NativeMetafile* GetMetafile();
vandebo (ex-Chrome) 2011/02/22 22:18:16 Get implies retrieval and not creation. Since thi
dpapad 2011/02/23 00:44:39 Done.
+
+#if defined(OS_LINUX)
+ static printing::NativeMetafile*
+ GetMetafileFrom(cairo_t* context);
+#endif
+
+ private:
+ MetafileFactory();
+ DISALLOW_COPY_AND_ASSIGN(MetafileFactory);
+};
+
+} // namespace printing
+
+#endif /* METAFILE_FACTORY_H_ */

Powered by Google App Engine
This is Rietveld 408576698