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/common_param_traits.h" | 5 #include "chrome/common/common_param_traits.h" |
6 | 6 |
7 #include "chrome/common/chrome_constants.h" | 7 #include "chrome/common/chrome_constants.h" |
8 #include "chrome/common/content_settings.h" | 8 #include "chrome/common/content_settings.h" |
9 #include "chrome/common/thumbnail_score.h" | 9 #include "chrome/common/thumbnail_score.h" |
10 #include "gfx/rect.h" | 10 #include "gfx/rect.h" |
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
400 L"%.6f %.6f %.6f %.6f " | 400 L"%.6f %.6f %.6f %.6f " |
401 L"%.6f %.6f %.6f ", | 401 L"%.6f %.6f %.6f ", |
402 p.latitude, p.longitude, p.accuracy, p.altitude, | 402 p.latitude, p.longitude, p.accuracy, p.altitude, |
403 p.altitude_accuracy, p.speed, p.heading)); | 403 p.altitude_accuracy, p.speed, p.heading)); |
404 LogParam(p.timestamp, l); | 404 LogParam(p.timestamp, l); |
405 l->append(L" "); | 405 l->append(L" "); |
406 l->append(UTF8ToWide(p.error_message)); | 406 l->append(UTF8ToWide(p.error_message)); |
407 LogParam(p.error_code, l); | 407 LogParam(p.error_code, l); |
408 } | 408 } |
409 | 409 |
410 void ParamTraits<webkit_glue::PasswordForm>::Write(Message* m, | |
411 const param_type& p) { | |
412 WriteParam(m, p.signon_realm); | |
413 WriteParam(m, p.origin); | |
414 WriteParam(m, p.action); | |
415 WriteParam(m, p.submit_element); | |
416 WriteParam(m, p.username_element); | |
417 WriteParam(m, p.username_value); | |
418 WriteParam(m, p.password_element); | |
419 WriteParam(m, p.password_value); | |
420 WriteParam(m, p.old_password_element); | |
421 WriteParam(m, p.old_password_value); | |
422 WriteParam(m, p.ssl_valid); | |
423 WriteParam(m, p.preferred); | |
424 WriteParam(m, p.blacklisted_by_user); | |
425 } | |
426 | |
427 bool ParamTraits<webkit_glue::PasswordForm>::Read(const Message* m, void** iter, | |
428 param_type* p) { | |
429 return | |
430 ReadParam(m, iter, &p->signon_realm) && | |
431 ReadParam(m, iter, &p->origin) && | |
432 ReadParam(m, iter, &p->action) && | |
433 ReadParam(m, iter, &p->submit_element) && | |
434 ReadParam(m, iter, &p->username_element) && | |
435 ReadParam(m, iter, &p->username_value) && | |
436 ReadParam(m, iter, &p->password_element) && | |
437 ReadParam(m, iter, &p->password_value) && | |
438 ReadParam(m, iter, &p->old_password_element) && | |
439 ReadParam(m, iter, &p->old_password_value) && | |
440 ReadParam(m, iter, &p->ssl_valid) && | |
441 ReadParam(m, iter, &p->preferred) && | |
442 ReadParam(m, iter, &p->blacklisted_by_user); | |
443 } | |
444 void ParamTraits<webkit_glue::PasswordForm>::Log(const param_type& p, | |
445 std::wstring* l) { | |
446 l->append(L"<PasswordForm>"); | |
447 } | |
448 | |
449 void ParamTraits<printing::PageRange>::Write(Message* m, const param_type& p) { | 410 void ParamTraits<printing::PageRange>::Write(Message* m, const param_type& p) { |
450 WriteParam(m, p.from); | 411 WriteParam(m, p.from); |
451 WriteParam(m, p.to); | 412 WriteParam(m, p.to); |
452 } | 413 } |
453 | 414 |
454 bool ParamTraits<printing::PageRange>::Read( | 415 bool ParamTraits<printing::PageRange>::Read( |
455 const Message* m, void** iter, param_type* p) { | 416 const Message* m, void** iter, param_type* p) { |
456 return ReadParam(m, iter, &p->from) && | 417 return ReadParam(m, iter, &p->from) && |
457 ReadParam(m, iter, &p->to); | 418 ReadParam(m, iter, &p->to); |
458 } | 419 } |
(...skipping 29 matching lines...) Expand all Loading... |
488 p->Init(&buffer.front(), static_cast<uint32>(buffer.size())); | 449 p->Init(&buffer.front(), static_cast<uint32>(buffer.size())); |
489 #endif // defined(OS_WIN) | 450 #endif // defined(OS_WIN) |
490 } | 451 } |
491 | 452 |
492 void ParamTraits<printing::NativeMetafile>::Log( | 453 void ParamTraits<printing::NativeMetafile>::Log( |
493 const param_type& p, std::wstring* l) { | 454 const param_type& p, std::wstring* l) { |
494 l->append(StringPrintf(L"<printing::NativeMetafile>")); | 455 l->append(StringPrintf(L"<printing::NativeMetafile>")); |
495 } | 456 } |
496 | 457 |
497 } // namespace IPC | 458 } // namespace IPC |
OLD | NEW |