| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 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 | 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 #include "chrome/common/render_messages_params.h" | 5 #include "chrome/common/render_messages_params.h" |
| 6 | 6 |
| 7 #include "chrome/common/navigation_gesture.h" | 7 #include "chrome/common/navigation_gesture.h" |
| 8 #include "chrome/common/common_param_traits.h" | 8 #include "chrome/common/common_param_traits.h" |
| 9 #include "chrome/common/indexed_db_param_traits.h" | 9 #include "chrome/common/indexed_db_param_traits.h" |
| 10 #include "chrome/common/render_messages.h" | 10 #include "chrome/common/render_messages.h" |
| (...skipping 1223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1234 LogParam(p.frame_name, l); | 1234 LogParam(p.frame_name, l); |
| 1235 l->append(")"); | 1235 l->append(")"); |
| 1236 } | 1236 } |
| 1237 | 1237 |
| 1238 void ParamTraits<ViewHostMsg_RunFileChooser_Params>::Write( | 1238 void ParamTraits<ViewHostMsg_RunFileChooser_Params>::Write( |
| 1239 Message* m, | 1239 Message* m, |
| 1240 const param_type& p) { | 1240 const param_type& p) { |
| 1241 WriteParam(m, static_cast<int>(p.mode)); | 1241 WriteParam(m, static_cast<int>(p.mode)); |
| 1242 WriteParam(m, p.title); | 1242 WriteParam(m, p.title); |
| 1243 WriteParam(m, p.default_file_name); | 1243 WriteParam(m, p.default_file_name); |
| 1244 WriteParam(m, p.accept_types); |
| 1244 } | 1245 } |
| 1245 | 1246 |
| 1246 bool ParamTraits<ViewHostMsg_RunFileChooser_Params>::Read( | 1247 bool ParamTraits<ViewHostMsg_RunFileChooser_Params>::Read( |
| 1247 const Message* m, | 1248 const Message* m, |
| 1248 void** iter, | 1249 void** iter, |
| 1249 param_type* p) { | 1250 param_type* p) { |
| 1250 int mode; | 1251 int mode; |
| 1251 if (!ReadParam(m, iter, &mode)) | 1252 if (!ReadParam(m, iter, &mode)) |
| 1252 return false; | 1253 return false; |
| 1253 if (mode != param_type::Open && | 1254 if (mode != param_type::Open && |
| 1254 mode != param_type::OpenMultiple && | 1255 mode != param_type::OpenMultiple && |
| 1255 mode != param_type::OpenFolder && | 1256 mode != param_type::OpenFolder && |
| 1256 mode != param_type::Save) | 1257 mode != param_type::Save) |
| 1257 return false; | 1258 return false; |
| 1258 p->mode = static_cast<param_type::Mode>(mode); | 1259 p->mode = static_cast<param_type::Mode>(mode); |
| 1259 return | 1260 return |
| 1260 ReadParam(m, iter, &p->title) && | 1261 ReadParam(m, iter, &p->title) && |
| 1261 ReadParam(m, iter, &p->default_file_name); | 1262 ReadParam(m, iter, &p->default_file_name) && |
| 1263 ReadParam(m, iter, &p->accept_types); |
| 1262 }; | 1264 }; |
| 1263 | 1265 |
| 1264 void ParamTraits<ViewHostMsg_RunFileChooser_Params>::Log( | 1266 void ParamTraits<ViewHostMsg_RunFileChooser_Params>::Log( |
| 1265 const param_type& p, | 1267 const param_type& p, |
| 1266 std::string* l) { | 1268 std::string* l) { |
| 1267 switch (p.mode) { | 1269 switch (p.mode) { |
| 1268 case param_type::Open: | 1270 case param_type::Open: |
| 1269 l->append("(Open, "); | 1271 l->append("(Open, "); |
| 1270 break; | 1272 break; |
| 1271 case param_type::OpenMultiple: | 1273 case param_type::OpenMultiple: |
| 1272 l->append("(OpenMultiple, "); | 1274 l->append("(OpenMultiple, "); |
| 1273 break; | 1275 break; |
| 1274 case param_type::OpenFolder: | 1276 case param_type::OpenFolder: |
| 1275 l->append("(OpenFolder, "); | 1277 l->append("(OpenFolder, "); |
| 1276 break; | 1278 break; |
| 1277 case param_type::Save: | 1279 case param_type::Save: |
| 1278 l->append("(Save, "); | 1280 l->append("(Save, "); |
| 1279 break; | 1281 break; |
| 1280 default: | 1282 default: |
| 1281 l->append("(UNKNOWN, "); | 1283 l->append("(UNKNOWN, "); |
| 1282 } | 1284 } |
| 1283 LogParam(p.title, l); | 1285 LogParam(p.title, l); |
| 1284 l->append(", "); | 1286 l->append(", "); |
| 1285 LogParam(p.default_file_name, l); | 1287 LogParam(p.default_file_name, l); |
| 1288 l->append(", "); |
| 1289 LogParam(p.accept_types, l); |
| 1286 } | 1290 } |
| 1287 | 1291 |
| 1288 void ParamTraits<ViewMsg_ExtensionRendererInfo>::Write(Message* m, | 1292 void ParamTraits<ViewMsg_ExtensionRendererInfo>::Write(Message* m, |
| 1289 const param_type& p) { | 1293 const param_type& p) { |
| 1290 WriteParam(m, p.id); | 1294 WriteParam(m, p.id); |
| 1291 WriteParam(m, p.web_extent); | 1295 WriteParam(m, p.web_extent); |
| 1292 WriteParam(m, p.name); | 1296 WriteParam(m, p.name); |
| 1293 WriteParam(m, p.icon_url); | 1297 WriteParam(m, p.icon_url); |
| 1294 WriteParam(m, p.location); | 1298 WriteParam(m, p.location); |
| 1295 } | 1299 } |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1497 const param_type& p, | 1501 const param_type& p, |
| 1498 std::string* l) { | 1502 std::string* l) { |
| 1499 l->append("("); | 1503 l->append("("); |
| 1500 LogParam(p.name, l); | 1504 LogParam(p.name, l); |
| 1501 l->append(", "); | 1505 l->append(", "); |
| 1502 LogParam(p.is_directory, l); | 1506 LogParam(p.is_directory, l); |
| 1503 l->append(")"); | 1507 l->append(")"); |
| 1504 } | 1508 } |
| 1505 | 1509 |
| 1506 } // namespace IPC | 1510 } // namespace IPC |
| OLD | NEW |