| 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 #include "base/string_number_conversions.h" |
| 5 #include "chrome/common/common_param_traits.h" | 6 #include "chrome/common/common_param_traits.h" |
| 6 #include "content/common/common_param_traits.h" | 7 #include "content/common/common_param_traits.h" |
| 7 | 8 |
| 8 #define IPC_MESSAGE_IMPL | 9 #define IPC_MESSAGE_IMPL |
| 9 #include "chrome/common/automation_messages.h" | 10 #include "chrome/common/automation_messages.h" |
| 10 | 11 |
| 11 AutomationURLRequest::AutomationURLRequest() | 12 AutomationURLRequest::AutomationURLRequest() |
| 12 : resource_type(0), | 13 : resource_type(0), |
| 13 load_flags(0) { | 14 load_flags(0) { |
| 14 } | 15 } |
| (...skipping 656 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 671 LogParam(p.dimensions, l); | 672 LogParam(p.dimensions, l); |
| 672 l->append(", "); | 673 l->append(", "); |
| 673 LogParam(p.disposition, l); | 674 LogParam(p.disposition, l); |
| 674 l->append(", "); | 675 l->append(", "); |
| 675 LogParam(p.user_gesture, l); | 676 LogParam(p.user_gesture, l); |
| 676 l->append(","); | 677 l->append(","); |
| 677 LogParam(p.profile_name, l); | 678 LogParam(p.profile_name, l); |
| 678 l->append(")"); | 679 l->append(")"); |
| 679 } | 680 } |
| 680 | 681 |
| 682 // static |
| 683 void ParamTraits<AutocompleteMatchData>::Write(Message* m, |
| 684 const param_type& p) { |
| 685 m->WriteString(p.provider_name); |
| 686 m->WriteInt(p.relevance); |
| 687 m->WriteBool(p.deletable); |
| 688 m->WriteString16(p.fill_into_edit); |
| 689 m->WriteSize(p.inline_autocomplete_offset); |
| 690 m->WriteString(p.destination_url.possibly_invalid_spec()); |
| 691 m->WriteString16(p.contents); |
| 692 m->WriteString16(p.description); |
| 693 m->WriteBool(p.is_history_what_you_typed_match); |
| 694 m->WriteString(p.type); |
| 695 m->WriteBool(p.starred); |
| 696 } |
| 697 |
| 698 // static |
| 699 bool ParamTraits<AutocompleteMatchData>::Read(const Message* m, |
| 700 void** iter, |
| 701 param_type* r) { |
| 702 std::string destination_url; |
| 703 if (!m->ReadString(iter, &r->provider_name) || |
| 704 !m->ReadInt(iter, &r->relevance) || |
| 705 !m->ReadBool(iter, &r->deletable) || |
| 706 !m->ReadString16(iter, &r->fill_into_edit) || |
| 707 !m->ReadSize(iter, &r->inline_autocomplete_offset) || |
| 708 !m->ReadString(iter, &destination_url) || |
| 709 !m->ReadString16(iter, &r->contents) || |
| 710 !m->ReadString16(iter, &r->description) || |
| 711 !m->ReadBool(iter, &r->is_history_what_you_typed_match) || |
| 712 !m->ReadString(iter, &r->type) || |
| 713 !m->ReadBool(iter, &r->starred)) |
| 714 return false; |
| 715 r->destination_url = GURL(destination_url); |
| 716 return true; |
| 717 } |
| 718 |
| 719 // static |
| 720 void ParamTraits<AutocompleteMatchData>::Log(const param_type& p, |
| 721 std::string* l) { |
| 722 l->append("["); |
| 723 l->append(p.provider_name); |
| 724 l->append(" "); |
| 725 l->append(base::IntToString(p.relevance)); |
| 726 l->append(" "); |
| 727 l->append(p.deletable ? "true" : "false"); |
| 728 l->append(" "); |
| 729 LogParam(p.fill_into_edit, l); |
| 730 l->append(" "); |
| 731 l->append(base::IntToString(p.inline_autocomplete_offset)); |
| 732 l->append(" "); |
| 733 l->append(p.destination_url.spec()); |
| 734 l->append(" "); |
| 735 LogParam(p.contents, l); |
| 736 l->append(" "); |
| 737 LogParam(p.description, l); |
| 738 l->append(" "); |
| 739 l->append(p.is_history_what_you_typed_match ? "true" : "false"); |
| 740 l->append(" "); |
| 741 l->append(p.type); |
| 742 l->append(" "); |
| 743 l->append(p.starred ? "true" : "false"); |
| 744 l->append("]"); |
| 745 } |
| 746 |
| 681 } // namespace IPC | 747 } // namespace IPC |
| OLD | NEW |