OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_COMMON_AUTOFILL_MESSAGES_H_ |
| 6 #define CHROME_COMMON_AUTOFILL_MESSAGES_H_ |
| 7 #pragma once |
| 8 |
| 9 #include <string> |
| 10 |
| 11 #include "ipc/ipc_message_macros.h" |
| 12 |
| 13 #define IPC_MESSAGE_START AutoFillMsgStart |
| 14 |
| 15 namespace webkit_glue { |
| 16 class FormField; |
| 17 struct FormData; |
| 18 struct PasswordForm; |
| 19 struct PasswordFormFillData; |
| 20 } |
| 21 |
| 22 namespace IPC { |
| 23 |
| 24 template <> |
| 25 struct ParamTraits<webkit_glue::FormField> { |
| 26 typedef webkit_glue::FormField param_type; |
| 27 static void Write(Message* m, const param_type& p); |
| 28 static bool Read(const Message* m, void** iter, param_type* p); |
| 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 } |
| 51 |
| 52 // AutoFill messages sent from the browser to the renderer. |
| 53 |
| 54 // Reply to the AutoFillHostMsg_QueryFormFieldAutoFill message with the |
| 55 // AutoFill suggestions. |
| 56 IPC_MESSAGE_ROUTED5(AutoFillMsg_SuggestionsReturned, |
| 57 int /* id of the request message */, |
| 58 std::vector<string16> /* names */, |
| 59 std::vector<string16> /* labels */, |
| 60 std::vector<string16> /* icons */, |
| 61 std::vector<int> /* unique_ids */) |
| 62 |
| 63 // Reply to the AutoFillHostMsg_FillAutoFillFormData message with the |
| 64 // AutoFill form data. |
| 65 IPC_MESSAGE_ROUTED2(AutoFillMsg_FormDataFilled, |
| 66 int /* id of the request message */, |
| 67 webkit_glue::FormData /* form data */) |
| 68 |
| 69 // Fill a password form and prepare field autocomplete for multiple |
| 70 // matching logins. |
| 71 IPC_MESSAGE_ROUTED1(AutoFillMsg_FillPasswordForm, |
| 72 webkit_glue::PasswordFormFillData) |
| 73 |
| 74 |
| 75 // AutoFill messages sent from the renderer to the browser. |
| 76 |
| 77 // Notification that forms have been seen that are candidates for |
| 78 // filling/submitting by the AutoFillManager. |
| 79 IPC_MESSAGE_ROUTED1(AutoFillHostMsg_FormsSeen, |
| 80 std::vector<webkit_glue::FormData> /* forms */) |
| 81 |
| 82 // Notification that password forms have been seen that are candidates for |
| 83 // filling/submitting by the password manager. |
| 84 IPC_MESSAGE_ROUTED1(AutoFillHostMsg_PasswordFormsFound, |
| 85 std::vector<webkit_glue::PasswordForm> /* forms */) |
| 86 |
| 87 // Notification that initial layout has occurred and the following password |
| 88 // forms are visible on the page (e.g. not set to display:none.) |
| 89 IPC_MESSAGE_ROUTED1(AutoFillHostMsg_PasswordFormsVisible, |
| 90 std::vector<webkit_glue::PasswordForm> /* forms */) |
| 91 |
| 92 // Notification that a form has been submitted. The user hit the button. |
| 93 IPC_MESSAGE_ROUTED1(AutoFillHostMsg_FormSubmitted, |
| 94 webkit_glue::FormData /* form */) |
| 95 |
| 96 // Queries the browser for AutoFill suggestions for a form input field. |
| 97 IPC_MESSAGE_ROUTED3(AutoFillHostMsg_QueryFormFieldAutoFill, |
| 98 int /* id of this message */, |
| 99 webkit_glue::FormData /* the form */, |
| 100 webkit_glue::FormField /* the form field */) |
| 101 |
| 102 // Sent when the popup with AutoFill suggestions for a form is shown. |
| 103 IPC_MESSAGE_ROUTED0(AutoFillHostMsg_DidShowAutoFillSuggestions) |
| 104 |
| 105 // Instructs the browser to fill in the values for a form using AutoFill |
| 106 // profile data. |
| 107 IPC_MESSAGE_ROUTED4(AutoFillHostMsg_FillAutoFillFormData, |
| 108 int /* id of this message */, |
| 109 webkit_glue::FormData /* the form */, |
| 110 webkit_glue::FormField /* the form field */, |
| 111 int /* profile unique ID */) |
| 112 |
| 113 // Sent when a form is previewed or filled with AutoFill suggestions. |
| 114 IPC_MESSAGE_ROUTED0(AutoFillHostMsg_DidFillAutoFillFormData) |
| 115 |
| 116 // Instructs the browser to remove the specified Autocomplete entry from the |
| 117 // database. |
| 118 IPC_MESSAGE_ROUTED2(AutoFillHostMsg_RemoveAutocompleteEntry, |
| 119 string16 /* field name */, |
| 120 string16 /* value */) |
| 121 |
| 122 // Instructs the browser to show the AutoFill dialog. |
| 123 IPC_MESSAGE_ROUTED0(AutoFillHostMsg_ShowAutoFillDialog) |
| 124 |
| 125 #endif // CHROME_COMMON_AUTOFILL_MESSAGES_H_ |
OLD | NEW |