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 18 matching lines...) Expand all Loading... |
29 int dpi_; | 29 int dpi_; |
30 bool autorotate_; | 30 bool autorotate_; |
31 }; | 31 }; |
32 | 32 |
33 } // namespace printing | 33 } // namespace printing |
34 | 34 |
35 namespace IPC { | 35 namespace IPC { |
36 template <> | 36 template <> |
37 struct ParamTraits<printing::PdfRenderSettings> { | 37 struct ParamTraits<printing::PdfRenderSettings> { |
38 typedef printing::PdfRenderSettings param_type; | 38 typedef printing::PdfRenderSettings param_type; |
39 static void Write(Message* m, const param_type& p) { | 39 static void Write(base::Pickle* m, const param_type& p) { |
40 WriteParam(m, p.area_); | 40 WriteParam(m, p.area_); |
41 WriteParam(m, p.dpi_); | 41 WriteParam(m, p.dpi_); |
42 WriteParam(m, p.autorotate_); | 42 WriteParam(m, p.autorotate_); |
43 } | 43 } |
44 | 44 |
45 static bool Read(const Message* m, base::PickleIterator* iter, | 45 static bool Read(const base::Pickle* m, |
| 46 base::PickleIterator* iter, |
46 param_type* r) { | 47 param_type* r) { |
47 return ReadParam(m, iter, &r->area_) && | 48 return ReadParam(m, iter, &r->area_) && |
48 ReadParam(m, iter, &r->dpi_) && | 49 ReadParam(m, iter, &r->dpi_) && |
49 ReadParam(m, iter, &r->autorotate_); | 50 ReadParam(m, iter, &r->autorotate_); |
50 } | 51 } |
51 | 52 |
52 static void Log(const param_type& p, std::string* l) { | 53 static void Log(const param_type& p, std::string* l) { |
53 LogParam(p.area_, l); | 54 LogParam(p.area_, l); |
54 l->append(", "); | 55 l->append(", "); |
55 LogParam(p.dpi_, l); | 56 LogParam(p.dpi_, l); |
56 l->append(", "); | 57 l->append(", "); |
57 LogParam(p.autorotate_, l); | 58 LogParam(p.autorotate_, l); |
58 } | 59 } |
59 }; | 60 }; |
60 | 61 |
61 } // namespace IPC | 62 } // namespace IPC |
62 | 63 |
63 #endif // PRINTING_PDF_RENDER_SETTINGS_H_ | 64 #endif // PRINTING_PDF_RENDER_SETTINGS_H_ |
OLD | NEW |