| 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 #ifndef CHROME_COMMON_RENDER_MESSAGES_H_ | 5 #ifndef CHROME_COMMON_RENDER_MESSAGES_H_ |
| 6 #define CHROME_COMMON_RENDER_MESSAGES_H_ | 6 #define CHROME_COMMON_RENDER_MESSAGES_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 939 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 950 // Traits for FormField_Params structure to pack/unpack. | 950 // Traits for FormField_Params structure to pack/unpack. |
| 951 template <> | 951 template <> |
| 952 struct ParamTraits<webkit_glue::FormField> { | 952 struct ParamTraits<webkit_glue::FormField> { |
| 953 typedef webkit_glue::FormField param_type; | 953 typedef webkit_glue::FormField param_type; |
| 954 static void Write(Message* m, const param_type& p) { | 954 static void Write(Message* m, const param_type& p) { |
| 955 WriteParam(m, p.label()); | 955 WriteParam(m, p.label()); |
| 956 WriteParam(m, p.name()); | 956 WriteParam(m, p.name()); |
| 957 WriteParam(m, p.value()); | 957 WriteParam(m, p.value()); |
| 958 WriteParam(m, p.form_control_type()); | 958 WriteParam(m, p.form_control_type()); |
| 959 WriteParam(m, p.size()); | 959 WriteParam(m, p.size()); |
| 960 WriteParam(m, p.option_strings()); |
| 960 } | 961 } |
| 961 static bool Read(const Message* m, void** iter, param_type* p) { | 962 static bool Read(const Message* m, void** iter, param_type* p) { |
| 962 string16 label, name, value, form_control_type; | 963 string16 label, name, value, form_control_type; |
| 963 int size = 0; | 964 int size = 0; |
| 965 std::vector<string16> options; |
| 964 bool result = ReadParam(m, iter, &label); | 966 bool result = ReadParam(m, iter, &label); |
| 965 result = result && ReadParam(m, iter, &name); | 967 result = result && ReadParam(m, iter, &name); |
| 966 result = result && ReadParam(m, iter, &value); | 968 result = result && ReadParam(m, iter, &value); |
| 967 result = result && ReadParam(m, iter, &form_control_type); | 969 result = result && ReadParam(m, iter, &form_control_type); |
| 968 result = result && ReadParam(m, iter, &size); | 970 result = result && ReadParam(m, iter, &size); |
| 971 result = result && ReadParam(m, iter, &options); |
| 969 if (!result) | 972 if (!result) |
| 970 return false; | 973 return false; |
| 971 | 974 |
| 972 p->set_label(label); | 975 p->set_label(label); |
| 973 p->set_name(name); | 976 p->set_name(name); |
| 974 p->set_value(value); | 977 p->set_value(value); |
| 975 p->set_form_control_type(form_control_type); | 978 p->set_form_control_type(form_control_type); |
| 976 p->set_size(size); | 979 p->set_size(size); |
| 980 p->set_option_strings(options); |
| 977 return true; | 981 return true; |
| 978 } | 982 } |
| 979 static void Log(const param_type& p, std::wstring* l) { | 983 static void Log(const param_type& p, std::wstring* l) { |
| 980 l->append(L"<FormField>"); | 984 l->append(L"<FormField>"); |
| 981 } | 985 } |
| 982 }; | 986 }; |
| 983 | 987 |
| 984 // Traits for FontDescriptor structure to pack/unpack. | 988 // Traits for FontDescriptor structure to pack/unpack. |
| 985 template <> | 989 template <> |
| 986 struct ParamTraits<FontDescriptor> { | 990 struct ParamTraits<FontDescriptor> { |
| (...skipping 2203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3190 l->append(L")"); | 3194 l->append(L")"); |
| 3191 } | 3195 } |
| 3192 }; | 3196 }; |
| 3193 | 3197 |
| 3194 } // namespace IPC | 3198 } // namespace IPC |
| 3195 | 3199 |
| 3196 #define MESSAGES_INTERNAL_FILE "chrome/common/render_messages_internal.h" | 3200 #define MESSAGES_INTERNAL_FILE "chrome/common/render_messages_internal.h" |
| 3197 #include "ipc/ipc_message_macros.h" | 3201 #include "ipc/ipc_message_macros.h" |
| 3198 | 3202 |
| 3199 #endif // CHROME_COMMON_RENDER_MESSAGES_H_ | 3203 #endif // CHROME_COMMON_RENDER_MESSAGES_H_ |
| OLD | NEW |