Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(612)

Side by Side Diff: chrome/common/render_messages.h

Issue 355003: Implement FormStructure and an initial method, EncodeUploadRequest. This als... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/chrome.gyp ('k') | webkit/glue/form_field.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 #include <map> 10 #include <map>
(...skipping 723 matching lines...) Expand 10 before | Expand all | Expand 10 after
734 l->append(L"<PasswordForm>"); 734 l->append(L"<PasswordForm>");
735 } 735 }
736 }; 736 };
737 737
738 // Traits for FormFieldValues_Params structure to pack/unpack. 738 // Traits for FormFieldValues_Params structure to pack/unpack.
739 template <> 739 template <>
740 struct ParamTraits<webkit_glue::FormFieldValues> { 740 struct ParamTraits<webkit_glue::FormFieldValues> {
741 typedef webkit_glue::FormFieldValues param_type; 741 typedef webkit_glue::FormFieldValues param_type;
742 static void Write(Message* m, const param_type& p) { 742 static void Write(Message* m, const param_type& p) {
743 WriteParam(m, p.form_name); 743 WriteParam(m, p.form_name);
744 WriteParam(m, p.method);
744 WriteParam(m, p.source_url); 745 WriteParam(m, p.source_url);
745 WriteParam(m, p.target_url); 746 WriteParam(m, p.target_url);
746 WriteParam(m, p.elements.size()); 747 WriteParam(m, p.elements.size());
747 std::vector<webkit_glue::FormField>::const_iterator itr; 748 std::vector<webkit_glue::FormField>::const_iterator itr;
748 for (itr = p.elements.begin(); itr != p.elements.end(); itr++) { 749 for (itr = p.elements.begin(); itr != p.elements.end(); itr++) {
749 WriteParam(m, itr->name()); 750 WriteParam(m, itr->name());
751 WriteParam(m, itr->html_input_type());
750 WriteParam(m, itr->value()); 752 WriteParam(m, itr->value());
751 } 753 }
752 } 754 }
753 static bool Read(const Message* m, void** iter, param_type* p) { 755 static bool Read(const Message* m, void** iter, param_type* p) {
754 bool result = true; 756 bool result = true;
755 result = result && 757 result = result &&
756 ReadParam(m, iter, &p->form_name) && 758 ReadParam(m, iter, &p->form_name) &&
759 ReadParam(m, iter, &p->method) &&
757 ReadParam(m, iter, &p->source_url) && 760 ReadParam(m, iter, &p->source_url) &&
758 ReadParam(m, iter, &p->target_url); 761 ReadParam(m, iter, &p->target_url);
759 size_t elements_size = 0; 762 size_t elements_size = 0;
760 result = result && ReadParam(m, iter, &elements_size); 763 result = result && ReadParam(m, iter, &elements_size);
761 p->elements.resize(elements_size); 764 p->elements.resize(elements_size);
762 for (size_t i = 0; i < elements_size; i++) { 765 for (size_t i = 0; i < elements_size; i++) {
763 string16 name, value; 766 string16 name, type, value;
764 result = result && ReadParam(m, iter, &name); 767 result = result && ReadParam(m, iter, &name);
768 result = result && ReadParam(m, iter, &type);
765 result = result && ReadParam(m, iter, &value); 769 result = result && ReadParam(m, iter, &value);
766 p->elements[i] = webkit_glue::FormField(name, value); 770 p->elements[i] = webkit_glue::FormField(name, type, value);
767 } 771 }
768 return result; 772 return result;
769 } 773 }
770 static void Log(const param_type& p, std::wstring* l) { 774 static void Log(const param_type& p, std::wstring* l) {
771 l->append(L"<FormFieldValues>"); 775 l->append(L"<FormFieldValues>");
772 } 776 }
773 }; 777 };
774 778
775 // Traits for ViewHostMsg_FrameNavigate_Params structure to pack/unpack. 779 // Traits for ViewHostMsg_FrameNavigate_Params structure to pack/unpack.
776 template <> 780 template <>
(...skipping 1383 matching lines...) Expand 10 before | Expand all | Expand 10 after
2160 } 2164 }
2161 }; 2165 };
2162 2166
2163 } // namespace IPC 2167 } // namespace IPC
2164 2168
2165 2169
2166 #define MESSAGES_INTERNAL_FILE "chrome/common/render_messages_internal.h" 2170 #define MESSAGES_INTERNAL_FILE "chrome/common/render_messages_internal.h"
2167 #include "ipc/ipc_message_macros.h" 2171 #include "ipc/ipc_message_macros.h"
2168 2172
2169 #endif // CHROME_COMMON_RENDER_MESSAGES_H_ 2173 #endif // CHROME_COMMON_RENDER_MESSAGES_H_
OLDNEW
« no previous file with comments | « chrome/chrome.gyp ('k') | webkit/glue/form_field.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698