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

Unified Diff: printing/emf_win.h

Issue 6695013: Cleanup NativeMetafile (win) interface and EMF class. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Typo Created 9 years, 9 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/emf_win.h
diff --git a/printing/emf_win.h b/printing/emf_win.h
index e054db3a5f63e3db4060999aac3fa3d7cbc3a6a7..693645e57fdd6fda344aae2f92474c11a9d9c507 100644
--- a/printing/emf_win.h
+++ b/printing/emf_win.h
@@ -27,10 +27,20 @@ class Emf : public NativeMetafile {
class Enumerator;
struct EnumerationContext;
+ // Generates a virtual HDC that will record every GDI commands and compile
+ // it in a EMF data stream.
+ Emf();
virtual ~Emf();
+ // Initializes the Emf with the data in |metafile_path|.
+ virtual bool Init(const FilePath& metafile_path);
+
// NativeMetafile methods.
- virtual bool Init() { return true; }
+
+ // Generates a new metafile that will record every GDI command.
+ virtual bool Init();
M-A Ruel 2011/03/17 13:19:21 By style code, we don't allow function overloads.
vandebo (ex-Chrome) 2011/03/17 23:38:06 I was copying the bad existing pattern, Fixed. An
+
+ // Initializes the Emf with the data in |src_buffer|. Returns true on success.
virtual bool Init(const void* src_buffer, uint32 src_buffer_size);
virtual bool StartPage();
@@ -57,14 +67,6 @@ class Emf : public NativeMetafile {
return hdc_;
}
- virtual bool CreateDc(HDC sibling, const RECT* rect);
- virtual bool CreateFileBackedDc(HDC sibling,
- const RECT* rect,
- const FilePath& path);
- virtual bool CreateFromFile(const FilePath& file_path);
-
- virtual void CloseEmf();
-
virtual bool Playback(HDC hdc, const RECT* rect) const;
virtual bool SafePlayback(HDC hdc) const;
@@ -74,16 +76,7 @@ class Emf : public NativeMetafile {
return emf_;
}
- protected:
- Emf();
-
private:
- friend class NativeMetafileFactory;
- FRIEND_TEST_ALL_PREFIXES(EmfTest, DC);
- FRIEND_TEST_ALL_PREFIXES(EmfTest, FileBackedDC);
- FRIEND_TEST_ALL_PREFIXES(EmfPrintingTest, Enumerate);
- FRIEND_TEST_ALL_PREFIXES(EmfPrintingTest, PageBreak);
-
// Playbacks safely one EMF record.
static int CALLBACK SafePlaybackProc(HDC hdc,
HANDLETABLE* handle_table,

Powered by Google App Engine
This is Rietveld 408576698