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

Side by Side Diff: printing/native_metafile.h

Issue 6709009: Stop overloading Init() in NativeMetafile. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « printing/image.cc ('k') | printing/pdf_metafile_mac.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef PRINTING_NATIVE_METAFILE_H_ 5 #ifndef PRINTING_NATIVE_METAFILE_H_
6 #define PRINTING_NATIVE_METAFILE_H_ 6 #define PRINTING_NATIVE_METAFILE_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "build/build_config.h" 9 #include "build/build_config.h"
10 #include "ui/gfx/native_widget_types.h" 10 #include "ui/gfx/native_widget_types.h"
(...skipping 30 matching lines...) Expand all
41 virtual ~NativeMetafile() {} 41 virtual ~NativeMetafile() {}
42 42
43 // Initializes a fresh new metafile for rendering. Returns false on failure. 43 // Initializes a fresh new metafile for rendering. Returns false on failure.
44 // Note: It should only be called from within the renderer process to allocate 44 // Note: It should only be called from within the renderer process to allocate
45 // rendering resources. 45 // rendering resources.
46 virtual bool Init() = 0; 46 virtual bool Init() = 0;
47 47
48 // Initializes the metafile with the data in |src_buffer|. Returns true 48 // Initializes the metafile with the data in |src_buffer|. Returns true
49 // on success. 49 // on success.
50 // Note: It should only be called from within the browser process. 50 // Note: It should only be called from within the browser process.
51 virtual bool Init(const void* src_buffer, uint32 src_buffer_size) = 0; 51 virtual bool InitFromData(const void* src_buffer, uint32 src_buffer_size) = 0;
52 52
53 #if defined(OS_WIN) 53 #if defined(OS_WIN)
54 // Inserts a custom GDICOMMENT records indicating StartPage/EndPage calls 54 // Inserts a custom GDICOMMENT records indicating StartPage/EndPage calls
55 // (since StartPage and EndPage do not work in a metafile DC). Only valid 55 // (since StartPage and EndPage do not work in a metafile DC). Only valid
56 // when hdc_ is non-NULL. 56 // when hdc_ is non-NULL.
57 virtual bool StartPage() = 0; 57 virtual bool StartPage() = 0;
58 #elif defined(OS_MACOSX) 58 #elif defined(OS_MACOSX)
59 // Prepares a new pdf page at specified |content_origin| with the given 59 // Prepares a new pdf page at specified |content_origin| with the given
60 // |page_size| and a |scale_factor| to use for the drawing. 60 // |page_size| and a |scale_factor| to use for the drawing.
61 virtual gfx::NativeDrawingContext StartPage(const gfx::Size& page_size, 61 virtual gfx::NativeDrawingContext StartPage(const gfx::Size& page_size,
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 // Returns true if writing succeeded. 180 // Returns true if writing succeeded.
181 virtual bool SaveToFD(const base::FileDescriptor& fd) const = 0; 181 virtual bool SaveToFD(const base::FileDescriptor& fd) const = 0;
182 #endif // if defined(OS_CHROMEOS) 182 #endif // if defined(OS_CHROMEOS)
183 183
184 #endif 184 #endif
185 }; 185 };
186 186
187 } // namespace printing 187 } // namespace printing
188 188
189 #endif // PRINTING_NATIVE_METAFILE_H_ 189 #endif // PRINTING_NATIVE_METAFILE_H_
OLDNEW
« no previous file with comments | « printing/image.cc ('k') | printing/pdf_metafile_mac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698