OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/common/webkit_param_traits.h" |
| 6 |
| 7 #include "third_party/WebKit/WebKit/chromium/public/WebCompositionUnderline.h" |
| 8 #include "third_party/WebKit/WebKit/chromium/public/WebFindOptions.h" |
| 9 #include "third_party/WebKit/WebKit/chromium/public/WebScreenInfo.h" |
| 10 |
| 11 namespace IPC { |
| 12 |
| 13 void ParamTraits<WebKit::WebRect>::Write(Message* m, const param_type& p) { |
| 14 WriteParam(m, p.x); |
| 15 WriteParam(m, p.y); |
| 16 WriteParam(m, p.width); |
| 17 WriteParam(m, p.height); |
| 18 } |
| 19 |
| 20 bool ParamTraits<WebKit::WebRect>::Read(const Message* m, void** iter, |
| 21 param_type* p) { |
| 22 return |
| 23 ReadParam(m, iter, &p->x) && |
| 24 ReadParam(m, iter, &p->y) && |
| 25 ReadParam(m, iter, &p->width) && |
| 26 ReadParam(m, iter, &p->height); |
| 27 } |
| 28 |
| 29 void ParamTraits<WebKit::WebRect>::Log(const param_type& p, std::wstring* l) { |
| 30 l->append(L"("); |
| 31 LogParam(p.x, l); |
| 32 l->append(L", "); |
| 33 LogParam(p.y, l); |
| 34 l->append(L", "); |
| 35 LogParam(p.width, l); |
| 36 l->append(L", "); |
| 37 LogParam(p.height, l); |
| 38 l->append(L")"); |
| 39 } |
| 40 |
| 41 void ParamTraits<WebKit::WebScreenInfo>::Write(Message* m, const param_type& p)
{ |
| 42 WriteParam(m, p.depth); |
| 43 WriteParam(m, p.depthPerComponent); |
| 44 WriteParam(m, p.isMonochrome); |
| 45 WriteParam(m, p.rect); |
| 46 WriteParam(m, p.availableRect); |
| 47 } |
| 48 |
| 49 bool ParamTraits<WebKit::WebScreenInfo>::Read(const Message* m, void** iter, |
| 50 param_type* p) { |
| 51 return |
| 52 ReadParam(m, iter, &p->depth) && |
| 53 ReadParam(m, iter, &p->depthPerComponent) && |
| 54 ReadParam(m, iter, &p->isMonochrome) && |
| 55 ReadParam(m, iter, &p->rect) && |
| 56 ReadParam(m, iter, &p->availableRect); |
| 57 } |
| 58 |
| 59 void ParamTraits<WebKit::WebScreenInfo>::Log(const param_type& p, |
| 60 std::wstring* l) { |
| 61 l->append(L"("); |
| 62 LogParam(p.depth, l); |
| 63 l->append(L", "); |
| 64 LogParam(p.depthPerComponent, l); |
| 65 l->append(L", "); |
| 66 LogParam(p.isMonochrome, l); |
| 67 l->append(L", "); |
| 68 LogParam(p.rect, l); |
| 69 l->append(L", "); |
| 70 LogParam(p.availableRect, l); |
| 71 l->append(L")"); |
| 72 } |
| 73 |
| 74 void ParamTraits<WebKit::WebFindOptions>::Write(Message* m, |
| 75 const param_type& p) { |
| 76 WriteParam(m, p.forward); |
| 77 WriteParam(m, p.matchCase); |
| 78 WriteParam(m, p.findNext); |
| 79 } |
| 80 |
| 81 bool ParamTraits<WebKit::WebFindOptions>::Read(const Message* m, void** iter, |
| 82 param_type* p) { |
| 83 return |
| 84 ReadParam(m, iter, &p->forward) && |
| 85 ReadParam(m, iter, &p->matchCase) && |
| 86 ReadParam(m, iter, &p->findNext); |
| 87 } |
| 88 |
| 89 void ParamTraits<WebKit::WebFindOptions>::Log(const param_type& p, |
| 90 std::wstring* l) { |
| 91 l->append(L"("); |
| 92 LogParam(p.forward, l); |
| 93 l->append(L", "); |
| 94 LogParam(p.matchCase, l); |
| 95 l->append(L", "); |
| 96 LogParam(p.findNext, l); |
| 97 l->append(L")"); |
| 98 } |
| 99 |
| 100 void ParamTraits<WebKit::WebCompositionUnderline>::Write(Message* m, |
| 101 const param_type& p) { |
| 102 WriteParam(m, p.startOffset); |
| 103 WriteParam(m, p.endOffset); |
| 104 WriteParam(m, p.color); |
| 105 WriteParam(m, p.thick); |
| 106 } |
| 107 |
| 108 bool ParamTraits<WebKit::WebCompositionUnderline>::Read( |
| 109 const Message* m, void** iter, |
| 110 param_type* p) { |
| 111 return |
| 112 ReadParam(m, iter, &p->startOffset) && |
| 113 ReadParam(m, iter, &p->endOffset) && |
| 114 ReadParam(m, iter, &p->color) && |
| 115 ReadParam(m, iter, &p->thick); |
| 116 } |
| 117 |
| 118 void ParamTraits<WebKit::WebCompositionUnderline>::Log(const param_type& p, |
| 119 std::wstring* l) { |
| 120 l->append(L"("); |
| 121 LogParam(p.startOffset, l); |
| 122 l->append(L","); |
| 123 LogParam(p.endOffset, l); |
| 124 l->append(L":"); |
| 125 LogParam(p.color, l); |
| 126 l->append(L":"); |
| 127 LogParam(p.thick, l); |
| 128 l->append(L")"); |
| 129 } |
| 130 |
| 131 } // namespace IPC |
OLD | NEW |