| 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 #ifndef CHROME_COMMON_AUTOFILL_MESSAGES_H_ | 5 // Multiply-included message file, hence no include guard. |
| 6 #define CHROME_COMMON_AUTOFILL_MESSAGES_H_ | |
| 7 #pragma once | |
| 8 | 6 |
| 9 #include <string> | 7 #include <string> |
| 10 | 8 |
| 9 #include "chrome/common/common_param_traits.h" |
| 11 #include "ipc/ipc_message_macros.h" | 10 #include "ipc/ipc_message_macros.h" |
| 11 #include "webkit/glue/form_data.h" |
| 12 #include "webkit/glue/form_field.h" |
| 13 #include "webkit/glue/password_form.h" |
| 14 #include "webkit/glue/password_form_dom_manager.h" |
| 12 | 15 |
| 13 #define IPC_MESSAGE_START AutoFillMsgStart | 16 #define IPC_MESSAGE_START AutoFillMsgStart |
| 14 | 17 |
| 15 namespace webkit_glue { | 18 IPC_STRUCT_TRAITS_BEGIN(webkit_glue::FormField) |
| 16 class FormField; | 19 IPC_STRUCT_TRAITS_MEMBER(label) |
| 17 struct FormData; | 20 IPC_STRUCT_TRAITS_MEMBER(name) |
| 18 struct PasswordForm; | 21 IPC_STRUCT_TRAITS_MEMBER(value) |
| 19 struct PasswordFormFillData; | 22 IPC_STRUCT_TRAITS_MEMBER(form_control_type) |
| 20 } | 23 IPC_STRUCT_TRAITS_MEMBER(max_length) |
| 24 IPC_STRUCT_TRAITS_MEMBER(is_autofilled) |
| 25 IPC_STRUCT_TRAITS_MEMBER(option_strings) |
| 26 IPC_STRUCT_TRAITS_END() |
| 21 | 27 |
| 22 namespace IPC { | 28 IPC_STRUCT_TRAITS_BEGIN(webkit_glue::FormData) |
| 29 IPC_STRUCT_TRAITS_MEMBER(name) |
| 30 IPC_STRUCT_TRAITS_MEMBER(method) |
| 31 IPC_STRUCT_TRAITS_MEMBER(origin) |
| 32 IPC_STRUCT_TRAITS_MEMBER(action) |
| 33 IPC_STRUCT_TRAITS_MEMBER(user_submitted) |
| 34 IPC_STRUCT_TRAITS_MEMBER(fields) |
| 35 IPC_STRUCT_TRAITS_END() |
| 23 | 36 |
| 24 template <> | 37 IPC_STRUCT_TRAITS_BEGIN(webkit_glue::PasswordFormFillData) |
| 25 struct ParamTraits<webkit_glue::FormField> { | 38 IPC_STRUCT_TRAITS_MEMBER(basic_data) |
| 26 typedef webkit_glue::FormField param_type; | 39 IPC_STRUCT_TRAITS_MEMBER(additional_logins) |
| 27 static void Write(Message* m, const param_type& p); | 40 IPC_STRUCT_TRAITS_MEMBER(wait_for_username) |
| 28 static bool Read(const Message* m, void** iter, param_type* p); | 41 IPC_STRUCT_TRAITS_END() |
| 29 static void Log(const param_type& p, std::string* l); | |
| 30 }; | |
| 31 | |
| 32 | |
| 33 // Traits for FormData structure to pack/unpack. | |
| 34 template <> | |
| 35 struct ParamTraits<webkit_glue::FormData> { | |
| 36 typedef webkit_glue::FormData param_type; | |
| 37 static void Write(Message* m, const param_type& p); | |
| 38 static bool Read(const Message* m, void** iter, param_type* p); | |
| 39 static void Log(const param_type& p, std::string* l); | |
| 40 }; | |
| 41 | |
| 42 template <> | |
| 43 struct ParamTraits<webkit_glue::PasswordFormFillData> { | |
| 44 typedef webkit_glue::PasswordFormFillData param_type; | |
| 45 static void Write(Message* m, const param_type& p); | |
| 46 static bool Read(const Message* m, void** iter, param_type* r); | |
| 47 static void Log(const param_type& p, std::string* l); | |
| 48 }; | |
| 49 | |
| 50 } // namespace IPC | |
| 51 | 42 |
| 52 // AutoFill messages sent from the browser to the renderer. | 43 // AutoFill messages sent from the browser to the renderer. |
| 53 | 44 |
| 54 // Reply to the AutoFillHostMsg_QueryFormFieldAutoFill message with the | 45 // Reply to the AutoFillHostMsg_QueryFormFieldAutoFill message with the |
| 55 // AutoFill suggestions. | 46 // AutoFill suggestions. |
| 56 IPC_MESSAGE_ROUTED5(AutoFillMsg_SuggestionsReturned, | 47 IPC_MESSAGE_ROUTED5(AutoFillMsg_SuggestionsReturned, |
| 57 int /* id of the request message */, | 48 int /* id of the request message */, |
| 58 std::vector<string16> /* names */, | 49 std::vector<string16> /* names */, |
| 59 std::vector<string16> /* labels */, | 50 std::vector<string16> /* labels */, |
| 60 std::vector<string16> /* icons */, | 51 std::vector<string16> /* icons */, |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 | 106 |
| 116 // Instructs the browser to remove the specified Autocomplete entry from the | 107 // Instructs the browser to remove the specified Autocomplete entry from the |
| 117 // database. | 108 // database. |
| 118 IPC_MESSAGE_ROUTED2(AutoFillHostMsg_RemoveAutocompleteEntry, | 109 IPC_MESSAGE_ROUTED2(AutoFillHostMsg_RemoveAutocompleteEntry, |
| 119 string16 /* field name */, | 110 string16 /* field name */, |
| 120 string16 /* value */) | 111 string16 /* value */) |
| 121 | 112 |
| 122 // Instructs the browser to show the AutoFill dialog. | 113 // Instructs the browser to show the AutoFill dialog. |
| 123 IPC_MESSAGE_ROUTED0(AutoFillHostMsg_ShowAutoFillDialog) | 114 IPC_MESSAGE_ROUTED0(AutoFillHostMsg_ShowAutoFillDialog) |
| 124 | 115 |
| 125 #endif // CHROME_COMMON_AUTOFILL_MESSAGES_H_ | 116 |
| OLD | NEW |