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

Unified Diff: printing/pdf_render_settings.h

Issue 2640033005: Substitute boolean GDI printing for a mode type (Closed)
Patch Set: Fix nits Created 3 years, 11 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
« no previous file with comments | « chrome/utility/printing_handler.cc ('k') | tools/ipc_fuzzer/fuzzer/fuzzer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: printing/pdf_render_settings.h
diff --git a/printing/pdf_render_settings.h b/printing/pdf_render_settings.h
index d9e8f9e7801fe134fa689712a33a3eb4f4c9a9aa..60425ec187c55eacf81bf5934e4c31e71c63d12b 100644
--- a/printing/pdf_render_settings.h
+++ b/printing/pdf_render_settings.h
@@ -5,6 +5,9 @@
#ifndef PRINTING_PDF_RENDER_SETTINGS_H_
#define PRINTING_PDF_RENDER_SETTINGS_H_
+#include <stdint.h>
+
+#include "ipc/ipc_message_macros.h"
#include "ipc/ipc_message_utils.h"
#include "ipc/ipc_param_traits.h"
#include "printing/printing_export.h"
@@ -16,45 +19,28 @@ namespace printing {
// Defining PDF rendering settings.
struct PdfRenderSettings {
- PdfRenderSettings() : dpi(0), autorotate(false) {}
- PdfRenderSettings(gfx::Rect area, int dpi, bool autorotate)
- : area(area), dpi(dpi), autorotate(autorotate) {}
+ enum Mode {
+ NORMAL = 0,
+#if defined(OS_WIN)
+ GDI_TEXT,
+ LAST = GDI_TEXT,
+#else
+ LAST = NORMAL,
+#endif
+ };
+
+ PdfRenderSettings() : dpi(0), autorotate(false), mode(Mode::NORMAL) {}
+ PdfRenderSettings(gfx::Rect area, int dpi, bool autorotate, Mode mode)
+ : area(area), dpi(dpi), autorotate(autorotate), mode(mode) {}
~PdfRenderSettings() {}
gfx::Rect area;
int dpi;
bool autorotate;
+ Mode mode;
};
} // namespace printing
-namespace IPC {
-template <>
-struct ParamTraits<printing::PdfRenderSettings> {
- typedef printing::PdfRenderSettings param_type;
- static void Write(base::Pickle* m, const param_type& p) {
- WriteParam(m, p.area);
- WriteParam(m, p.dpi);
- WriteParam(m, p.autorotate);
- }
-
- static bool Read(const base::Pickle* m,
- base::PickleIterator* iter,
- param_type* r) {
- return ReadParam(m, iter, &r->area) &&
- ReadParam(m, iter, &r->dpi) &&
- ReadParam(m, iter, &r->autorotate);
- }
-
- static void Log(const param_type& p, std::string* l) {
- LogParam(p.area, l);
- l->append(", ");
- LogParam(p.dpi, l);
- l->append(", ");
- LogParam(p.autorotate, l);
- }
-};
-
-} // namespace IPC
-
#endif // PRINTING_PDF_RENDER_SETTINGS_H_
+
« no previous file with comments | « chrome/utility/printing_handler.cc ('k') | tools/ipc_fuzzer/fuzzer/fuzzer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698