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

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: Skip compiling the chromeos context if we don't compile against cups 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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 #elif defined(OS_MACOSX) 79 #elif defined(OS_MACOSX)
80 // Renders the given page into |rect| in the given context. 80 // Renders the given page into |rect| in the given context.
81 // Pages use a 1-based index. The rendering uses the arguments in 81 // Pages use a 1-based index. The rendering uses the arguments in
82 // |params| to determine scaling, translation, and rotation. 82 // |params| to determine scaling, translation, and rotation.
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 #if defined(OS_CHROMEOS)
90 // Populates the buffer with the underlying data. This function should ONLY be
91 // called after the metafile is closed. Returns true if writing succeeded.
92 virtual bool GetDataAsVector(std::vector<char>* buffer) const = 0;
93 #endif // defined(OS_CHROMEOS)
94
89 // Saves the underlying data to the given file. This function should ONLY be 95 // 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. 96 // called after the metafile is closed. Returns true if writing succeeded.
91 virtual bool SaveTo(base::File* file) const = 0; 97 virtual bool SaveTo(base::File* file) const = 0;
92 98
93 private: 99 private:
94 DISALLOW_COPY_AND_ASSIGN(MetafilePlayer); 100 DISALLOW_COPY_AND_ASSIGN(MetafilePlayer);
95 }; 101 };
96 102
97 // This class creates a graphics context that renders into a data stream 103 // This class creates a graphics context that renders into a data stream
98 // (usually PDF or EMF). 104 // (usually PDF or EMF).
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 // "logical units" and is optional. If |rect| is NULL, the natural EMF bounds 154 // "logical units" and is optional. If |rect| is NULL, the natural EMF bounds
149 // are used. 155 // are used.
150 // Note: Windows has been known to have stack buffer overflow in its GDI 156 // Note: Windows has been known to have stack buffer overflow in its GDI
151 // functions, whether used directly or indirectly through precompiled EMF 157 // 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, 158 // data. We have to accept the risk here. Since it is used only for printing,
153 // it requires user intervention. 159 // it requires user intervention.
154 virtual bool Playback(gfx::NativeDrawingContext hdc, 160 virtual bool Playback(gfx::NativeDrawingContext hdc,
155 const RECT* rect) const = 0; 161 const RECT* rect) const = 0;
156 #endif // OS_WIN 162 #endif // OS_WIN
157 163
164 #if defined(OS_CHROMEOS)
165 bool GetDataAsVector(std::vector<char>* buffer) const override;
166 #else
158 bool GetDataAsVector(std::vector<char>* buffer) const; 167 bool GetDataAsVector(std::vector<char>* buffer) const;
Lei Zhang 2016/07/20 01:26:56 This feels a bit weird. Why don't we just remove t
skau 2016/07/22 23:36:13 It happens that there's a Windows implementation o
168 #endif // defined(OS_CHROMEOS)
159 169
160 bool SaveTo(base::File* file) const override; 170 bool SaveTo(base::File* file) const override;
161 171
162 private: 172 private:
163 DISALLOW_COPY_AND_ASSIGN(Metafile); 173 DISALLOW_COPY_AND_ASSIGN(Metafile);
164 }; 174 };
165 175
166 } // namespace printing 176 } // namespace printing
167 177
168 #endif // PRINTING_METAFILE_H_ 178 #endif // PRINTING_METAFILE_H_
OLDNEW
« no previous file with comments | « printing/BUILD.gn ('k') | printing/printed_document.cc » ('j') | printing/printing.gyp » ('J')

Powered by Google App Engine
This is Rietveld 408576698