| OLD | NEW |
| 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_PDF_RENDER_SETTINGS_H_ | 5 #ifndef PRINTING_PDF_RENDER_SETTINGS_H_ |
| 6 #define PRINTING_PDF_RENDER_SETTINGS_H_ | 6 #define PRINTING_PDF_RENDER_SETTINGS_H_ |
| 7 | 7 |
| 8 #include "ipc/ipc_message_utils.h" | 8 #include "ipc/ipc_message_utils.h" |
| 9 #include "ipc/ipc_param_traits.h" | 9 #include "ipc/ipc_param_traits.h" |
| 10 #include "printing/printing_export.h" | 10 #include "printing/printing_export.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 int dpi; | 25 int dpi; |
| 26 bool autorotate; | 26 bool autorotate; |
| 27 }; | 27 }; |
| 28 | 28 |
| 29 } // namespace printing | 29 } // namespace printing |
| 30 | 30 |
| 31 namespace IPC { | 31 namespace IPC { |
| 32 template <> | 32 template <> |
| 33 struct ParamTraits<printing::PdfRenderSettings> { | 33 struct ParamTraits<printing::PdfRenderSettings> { |
| 34 typedef printing::PdfRenderSettings param_type; | 34 typedef printing::PdfRenderSettings param_type; |
| 35 |
| 36 static void GetSize(base::PickleSizer* s, const param_type& p) { |
| 37 GetParamSize(s, p.area); |
| 38 GetParamSize(s, p.dpi); |
| 39 GetParamSize(s, p.autorotate); |
| 40 } |
| 41 |
| 35 static void Write(base::Pickle* m, const param_type& p) { | 42 static void Write(base::Pickle* m, const param_type& p) { |
| 36 WriteParam(m, p.area); | 43 WriteParam(m, p.area); |
| 37 WriteParam(m, p.dpi); | 44 WriteParam(m, p.dpi); |
| 38 WriteParam(m, p.autorotate); | 45 WriteParam(m, p.autorotate); |
| 39 } | 46 } |
| 40 | 47 |
| 41 static bool Read(const base::Pickle* m, | 48 static bool Read(const base::Pickle* m, |
| 42 base::PickleIterator* iter, | 49 base::PickleIterator* iter, |
| 43 param_type* r) { | 50 param_type* r) { |
| 44 return ReadParam(m, iter, &r->area) && | 51 return ReadParam(m, iter, &r->area) && |
| 45 ReadParam(m, iter, &r->dpi) && | 52 ReadParam(m, iter, &r->dpi) && |
| 46 ReadParam(m, iter, &r->autorotate); | 53 ReadParam(m, iter, &r->autorotate); |
| 47 } | 54 } |
| 48 | 55 |
| 49 static void Log(const param_type& p, std::string* l) { | 56 static void Log(const param_type& p, std::string* l) { |
| 50 LogParam(p.area, l); | 57 LogParam(p.area, l); |
| 51 l->append(", "); | 58 l->append(", "); |
| 52 LogParam(p.dpi, l); | 59 LogParam(p.dpi, l); |
| 53 l->append(", "); | 60 l->append(", "); |
| 54 LogParam(p.autorotate, l); | 61 LogParam(p.autorotate, l); |
| 55 } | 62 } |
| 56 }; | 63 }; |
| 57 | 64 |
| 58 } // namespace IPC | 65 } // namespace IPC |
| 59 | 66 |
| 60 #endif // PRINTING_PDF_RENDER_SETTINGS_H_ | 67 #endif // PRINTING_PDF_RENDER_SETTINGS_H_ |
| OLD | NEW |