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

Side by Side Diff: printing/metafile.h

Issue 2117713002: Print directly to CUPS using the IPP APIs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ippRead
Patch Set: Loggin cleaned up Created 4 years, 5 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_METAFILE_H_ 5 #ifndef PRINTING_METAFILE_H_
6 #define PRINTING_METAFILE_H_ 6 #define PRINTING_METAFILE_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <vector> 10 #include <vector>
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 virtual bool RenderPage(unsigned int page_number, 83 virtual bool RenderPage(unsigned int page_number,
84 gfx::NativeDrawingContext context, 84 gfx::NativeDrawingContext context,
85 const CGRect rect, 85 const CGRect rect,
86 const MacRenderPageParams& params) const = 0; 86 const MacRenderPageParams& params) const = 0;
87 #endif // if defined(OS_WIN) 87 #endif // if defined(OS_WIN)
88 88
89 // Saves the underlying data to the given file. This function should ONLY be 89 // Saves the underlying data to the given file. This function should ONLY be
90 // called after the metafile is closed. Returns true if writing succeeded. 90 // called after the metafile is closed. Returns true if writing succeeded.
91 virtual bool SaveTo(base::File* file) const = 0; 91 virtual bool SaveTo(base::File* file) const = 0;
92 92
93 // Populates the buffer with the underlying data. This function should ONLY be
94 // called after the metafile is closed. Returns true if writing succeeded.
95 virtual bool GetDataAsVector(std::vector<char>* buffer) const = 0;
Lei Zhang 2016/07/08 01:35:26 Put this above SaveTo() since the impl below is al
skau 2016/07/09 00:28:33 Done.
96
93 private: 97 private:
94 DISALLOW_COPY_AND_ASSIGN(MetafilePlayer); 98 DISALLOW_COPY_AND_ASSIGN(MetafilePlayer);
95 }; 99 };
96 100
97 // This class creates a graphics context that renders into a data stream 101 // This class creates a graphics context that renders into a data stream
98 // (usually PDF or EMF). 102 // (usually PDF or EMF).
99 class PRINTING_EXPORT Metafile : public MetafilePlayer { 103 class PRINTING_EXPORT Metafile : public MetafilePlayer {
100 public: 104 public:
101 Metafile(); 105 Metafile();
102 ~Metafile() override; 106 ~Metafile() override;
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 // "logical units" and is optional. If |rect| is NULL, the natural EMF bounds 152 // "logical units" and is optional. If |rect| is NULL, the natural EMF bounds
149 // are used. 153 // are used.
150 // Note: Windows has been known to have stack buffer overflow in its GDI 154 // Note: Windows has been known to have stack buffer overflow in its GDI
151 // functions, whether used directly or indirectly through precompiled EMF 155 // functions, whether used directly or indirectly through precompiled EMF
152 // data. We have to accept the risk here. Since it is used only for printing, 156 // data. We have to accept the risk here. Since it is used only for printing,
153 // it requires user intervention. 157 // it requires user intervention.
154 virtual bool Playback(gfx::NativeDrawingContext hdc, 158 virtual bool Playback(gfx::NativeDrawingContext hdc,
155 const RECT* rect) const = 0; 159 const RECT* rect) const = 0;
156 #endif // OS_WIN 160 #endif // OS_WIN
157 161
158 bool GetDataAsVector(std::vector<char>* buffer) const; 162 bool GetDataAsVector(std::vector<char>* buffer) const override;
159 163
160 bool SaveTo(base::File* file) const override; 164 bool SaveTo(base::File* file) const override;
161 165
162 private: 166 private:
163 DISALLOW_COPY_AND_ASSIGN(Metafile); 167 DISALLOW_COPY_AND_ASSIGN(Metafile);
164 }; 168 };
165 169
166 } // namespace printing 170 } // namespace printing
167 171
168 #endif // PRINTING_METAFILE_H_ 172 #endif // PRINTING_METAFILE_H_
OLDNEW
« no previous file with comments | « printing/BUILD.gn ('k') | printing/printed_document.cc » ('j') | printing/printed_document.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698