| 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 // Multiply-included message file, hence no include guard. | 5 // Multiply-included message file, hence no include guard. |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/time.h" | 9 #include "base/time.h" |
| 10 #include "content/public/common/webkit_param_traits.h" | 10 #include "content/public/common/webkit_param_traits.h" |
| 11 #include "ipc/ipc_message_macros.h" | 11 #include "ipc/ipc_message_macros.h" |
| 12 #include "ipc/ipc_message_utils.h" | 12 #include "ipc/ipc_message_utils.h" |
| 13 #include "ui/gfx/rect.h" | 13 #include "ui/gfx/rect.h" |
| 14 #include "webkit/glue/form_data.h" | 14 #include "webkit/forms/form_data.h" |
| 15 #include "webkit/glue/form_data_predictions.h" | 15 #include "webkit/forms/form_data_predictions.h" |
| 16 #include "webkit/glue/form_field.h" | 16 #include "webkit/forms/form_field.h" |
| 17 #include "webkit/glue/form_field_predictions.h" | 17 #include "webkit/forms/form_field_predictions.h" |
| 18 #include "webkit/glue/password_form.h" | 18 #include "webkit/forms/password_form.h" |
| 19 #include "webkit/glue/password_form_dom_manager.h" | 19 #include "webkit/forms/password_form_dom_manager.h" |
| 20 | 20 |
| 21 #define IPC_MESSAGE_START AutofillMsgStart | 21 #define IPC_MESSAGE_START AutofillMsgStart |
| 22 | 22 |
| 23 IPC_STRUCT_TRAITS_BEGIN(webkit_glue::FormField) | 23 IPC_STRUCT_TRAITS_BEGIN(webkit::forms::FormField) |
| 24 IPC_STRUCT_TRAITS_MEMBER(label) | 24 IPC_STRUCT_TRAITS_MEMBER(label) |
| 25 IPC_STRUCT_TRAITS_MEMBER(name) | 25 IPC_STRUCT_TRAITS_MEMBER(name) |
| 26 IPC_STRUCT_TRAITS_MEMBER(value) | 26 IPC_STRUCT_TRAITS_MEMBER(value) |
| 27 IPC_STRUCT_TRAITS_MEMBER(form_control_type) | 27 IPC_STRUCT_TRAITS_MEMBER(form_control_type) |
| 28 IPC_STRUCT_TRAITS_MEMBER(autocomplete_type) | 28 IPC_STRUCT_TRAITS_MEMBER(autocomplete_type) |
| 29 IPC_STRUCT_TRAITS_MEMBER(max_length) | 29 IPC_STRUCT_TRAITS_MEMBER(max_length) |
| 30 IPC_STRUCT_TRAITS_MEMBER(is_autofilled) | 30 IPC_STRUCT_TRAITS_MEMBER(is_autofilled) |
| 31 IPC_STRUCT_TRAITS_MEMBER(is_focusable) | 31 IPC_STRUCT_TRAITS_MEMBER(is_focusable) |
| 32 IPC_STRUCT_TRAITS_MEMBER(should_autocomplete) | 32 IPC_STRUCT_TRAITS_MEMBER(should_autocomplete) |
| 33 IPC_STRUCT_TRAITS_MEMBER(option_values) | 33 IPC_STRUCT_TRAITS_MEMBER(option_values) |
| 34 IPC_STRUCT_TRAITS_MEMBER(option_contents) | 34 IPC_STRUCT_TRAITS_MEMBER(option_contents) |
| 35 IPC_STRUCT_TRAITS_END() | 35 IPC_STRUCT_TRAITS_END() |
| 36 | 36 |
| 37 IPC_STRUCT_TRAITS_BEGIN(webkit_glue::FormFieldPredictions) | 37 IPC_STRUCT_TRAITS_BEGIN(webkit::forms::FormFieldPredictions) |
| 38 IPC_STRUCT_TRAITS_MEMBER(field) | 38 IPC_STRUCT_TRAITS_MEMBER(field) |
| 39 IPC_STRUCT_TRAITS_MEMBER(signature) | 39 IPC_STRUCT_TRAITS_MEMBER(signature) |
| 40 IPC_STRUCT_TRAITS_MEMBER(heuristic_type) | 40 IPC_STRUCT_TRAITS_MEMBER(heuristic_type) |
| 41 IPC_STRUCT_TRAITS_MEMBER(server_type) | 41 IPC_STRUCT_TRAITS_MEMBER(server_type) |
| 42 IPC_STRUCT_TRAITS_MEMBER(overall_type) | 42 IPC_STRUCT_TRAITS_MEMBER(overall_type) |
| 43 IPC_STRUCT_TRAITS_END() | 43 IPC_STRUCT_TRAITS_END() |
| 44 | 44 |
| 45 IPC_STRUCT_TRAITS_BEGIN(webkit_glue::FormData) | 45 IPC_STRUCT_TRAITS_BEGIN(webkit::forms::FormData) |
| 46 IPC_STRUCT_TRAITS_MEMBER(name) | 46 IPC_STRUCT_TRAITS_MEMBER(name) |
| 47 IPC_STRUCT_TRAITS_MEMBER(method) | 47 IPC_STRUCT_TRAITS_MEMBER(method) |
| 48 IPC_STRUCT_TRAITS_MEMBER(origin) | 48 IPC_STRUCT_TRAITS_MEMBER(origin) |
| 49 IPC_STRUCT_TRAITS_MEMBER(action) | 49 IPC_STRUCT_TRAITS_MEMBER(action) |
| 50 IPC_STRUCT_TRAITS_MEMBER(user_submitted) | 50 IPC_STRUCT_TRAITS_MEMBER(user_submitted) |
| 51 IPC_STRUCT_TRAITS_MEMBER(fields) | 51 IPC_STRUCT_TRAITS_MEMBER(fields) |
| 52 IPC_STRUCT_TRAITS_END() | 52 IPC_STRUCT_TRAITS_END() |
| 53 | 53 |
| 54 IPC_STRUCT_TRAITS_BEGIN(webkit_glue::FormDataPredictions) | 54 IPC_STRUCT_TRAITS_BEGIN(webkit::forms::FormDataPredictions) |
| 55 IPC_STRUCT_TRAITS_MEMBER(data) | 55 IPC_STRUCT_TRAITS_MEMBER(data) |
| 56 IPC_STRUCT_TRAITS_MEMBER(signature) | 56 IPC_STRUCT_TRAITS_MEMBER(signature) |
| 57 IPC_STRUCT_TRAITS_MEMBER(experiment_id) | 57 IPC_STRUCT_TRAITS_MEMBER(experiment_id) |
| 58 IPC_STRUCT_TRAITS_MEMBER(fields) | 58 IPC_STRUCT_TRAITS_MEMBER(fields) |
| 59 IPC_STRUCT_TRAITS_END() | 59 IPC_STRUCT_TRAITS_END() |
| 60 | 60 |
| 61 IPC_STRUCT_TRAITS_BEGIN(webkit_glue::PasswordFormFillData) | 61 IPC_STRUCT_TRAITS_BEGIN(webkit::forms::PasswordFormFillData) |
| 62 IPC_STRUCT_TRAITS_MEMBER(basic_data) | 62 IPC_STRUCT_TRAITS_MEMBER(basic_data) |
| 63 IPC_STRUCT_TRAITS_MEMBER(additional_logins) | 63 IPC_STRUCT_TRAITS_MEMBER(additional_logins) |
| 64 IPC_STRUCT_TRAITS_MEMBER(wait_for_username) | 64 IPC_STRUCT_TRAITS_MEMBER(wait_for_username) |
| 65 IPC_STRUCT_TRAITS_END() | 65 IPC_STRUCT_TRAITS_END() |
| 66 | 66 |
| 67 // Autofill messages sent from the browser to the renderer. | 67 // Autofill messages sent from the browser to the renderer. |
| 68 | 68 |
| 69 // Reply to the AutofillHostMsg_QueryFormFieldAutofill message with the | 69 // Reply to the AutofillHostMsg_QueryFormFieldAutofill message with the |
| 70 // Autofill suggestions. | 70 // Autofill suggestions. |
| 71 IPC_MESSAGE_ROUTED5(AutofillMsg_SuggestionsReturned, | 71 IPC_MESSAGE_ROUTED5(AutofillMsg_SuggestionsReturned, |
| 72 int /* id of the request message */, | 72 int /* id of the request message */, |
| 73 std::vector<string16> /* names */, | 73 std::vector<string16> /* names */, |
| 74 std::vector<string16> /* labels */, | 74 std::vector<string16> /* labels */, |
| 75 std::vector<string16> /* icons */, | 75 std::vector<string16> /* icons */, |
| 76 std::vector<int> /* unique_ids */) | 76 std::vector<int> /* unique_ids */) |
| 77 | 77 |
| 78 // Reply to the AutofillHostMsg_FillAutofillFormData message with the | 78 // Reply to the AutofillHostMsg_FillAutofillFormData message with the |
| 79 // Autofill form data. | 79 // Autofill form data. |
| 80 IPC_MESSAGE_ROUTED2(AutofillMsg_FormDataFilled, | 80 IPC_MESSAGE_ROUTED2(AutofillMsg_FormDataFilled, |
| 81 int /* id of the request message */, | 81 int /* id of the request message */, |
| 82 webkit_glue::FormData /* form data */) | 82 webkit::forms::FormData /* form data */) |
| 83 | 83 |
| 84 // Fill a password form and prepare field autocomplete for multiple | 84 // Fill a password form and prepare field autocomplete for multiple |
| 85 // matching logins. | 85 // matching logins. |
| 86 IPC_MESSAGE_ROUTED1(AutofillMsg_FillPasswordForm, | 86 IPC_MESSAGE_ROUTED1(AutofillMsg_FillPasswordForm, |
| 87 webkit_glue::PasswordFormFillData) | 87 webkit::forms::PasswordFormFillData) |
| 88 | 88 |
| 89 // Send the heuristic and server field type predictions to the renderer. | 89 // Send the heuristic and server field type predictions to the renderer. |
| 90 IPC_MESSAGE_ROUTED1( | 90 IPC_MESSAGE_ROUTED1( |
| 91 AutofillMsg_FieldTypePredictionsAvailable, | 91 AutofillMsg_FieldTypePredictionsAvailable, |
| 92 std::vector<webkit_glue::FormDataPredictions> /* forms */) | 92 std::vector<webkit::forms::FormDataPredictions> /* forms */) |
| 93 | 93 |
| 94 // Select an Autofill item when using an external delegate. | 94 // Select an Autofill item when using an external delegate. |
| 95 IPC_MESSAGE_ROUTED1(AutofillMsg_SelectAutofillSuggestionAtIndex, | 95 IPC_MESSAGE_ROUTED1(AutofillMsg_SelectAutofillSuggestionAtIndex, |
| 96 int /* listIndex */) | 96 int /* listIndex */) |
| 97 | 97 |
| 98 // Autofill messages sent from the renderer to the browser. | 98 // Autofill messages sent from the renderer to the browser. |
| 99 | 99 |
| 100 // Notification that forms have been seen that are candidates for | 100 // Notification that forms have been seen that are candidates for |
| 101 // filling/submitting by the AutofillManager. | 101 // filling/submitting by the AutofillManager. |
| 102 IPC_MESSAGE_ROUTED2(AutofillHostMsg_FormsSeen, | 102 IPC_MESSAGE_ROUTED2(AutofillHostMsg_FormsSeen, |
| 103 std::vector<webkit_glue::FormData> /* forms */, | 103 std::vector<webkit::forms::FormData> /* forms */, |
| 104 base::TimeTicks /* timestamp */) | 104 base::TimeTicks /* timestamp */) |
| 105 | 105 |
| 106 // Notification that password forms have been seen that are candidates for | 106 // Notification that password forms have been seen that are candidates for |
| 107 // filling/submitting by the password manager. | 107 // filling/submitting by the password manager. |
| 108 IPC_MESSAGE_ROUTED1(AutofillHostMsg_PasswordFormsFound, | 108 IPC_MESSAGE_ROUTED1(AutofillHostMsg_PasswordFormsFound, |
| 109 std::vector<webkit_glue::PasswordForm> /* forms */) | 109 std::vector<webkit::forms::PasswordForm> /* forms */) |
| 110 | 110 |
| 111 // Notification that initial layout has occurred and the following password | 111 // Notification that initial layout has occurred and the following password |
| 112 // forms are visible on the page (e.g. not set to display:none.) | 112 // forms are visible on the page (e.g. not set to display:none.) |
| 113 IPC_MESSAGE_ROUTED1(AutofillHostMsg_PasswordFormsVisible, | 113 IPC_MESSAGE_ROUTED1(AutofillHostMsg_PasswordFormsVisible, |
| 114 std::vector<webkit_glue::PasswordForm> /* forms */) | 114 std::vector<webkit::forms::PasswordForm> /* forms */) |
| 115 | 115 |
| 116 // Notification that a form has been submitted. The user hit the button. | 116 // Notification that a form has been submitted. The user hit the button. |
| 117 IPC_MESSAGE_ROUTED2(AutofillHostMsg_FormSubmitted, | 117 IPC_MESSAGE_ROUTED2(AutofillHostMsg_FormSubmitted, |
| 118 webkit_glue::FormData /* form */, | 118 webkit::forms::FormData /* form */, |
| 119 base::TimeTicks /* timestamp */) | 119 base::TimeTicks /* timestamp */) |
| 120 | 120 |
| 121 // Notification that a form field's value has changed. | 121 // Notification that a form field's value has changed. |
| 122 IPC_MESSAGE_ROUTED3(AutofillHostMsg_TextFieldDidChange, | 122 IPC_MESSAGE_ROUTED3(AutofillHostMsg_TextFieldDidChange, |
| 123 webkit_glue::FormData /* the form */, | 123 webkit::forms::FormData /* the form */, |
| 124 webkit_glue::FormField /* the form field */, | 124 webkit::forms::FormField /* the form field */, |
| 125 base::TimeTicks /* timestamp */) | 125 base::TimeTicks /* timestamp */) |
| 126 | 126 |
| 127 // Queries the browser for Autofill suggestions for a form input field. | 127 // Queries the browser for Autofill suggestions for a form input field. |
| 128 IPC_MESSAGE_ROUTED5(AutofillHostMsg_QueryFormFieldAutofill, | 128 IPC_MESSAGE_ROUTED5(AutofillHostMsg_QueryFormFieldAutofill, |
| 129 int /* id of this message */, | 129 int /* id of this message */, |
| 130 webkit_glue::FormData /* the form */, | 130 webkit::forms::FormData /* the form */, |
| 131 webkit_glue::FormField /* the form field */, | 131 webkit::forms::FormField /* the form field */, |
| 132 gfx::Rect /* input field bounds, window-relative */, | 132 gfx::Rect /* input field bounds, window-relative */, |
| 133 bool /* display warning if autofill disabled */) | 133 bool /* display warning if autofill disabled */) |
| 134 | 134 |
| 135 // Sent when the popup with Autofill suggestions for a form is shown. | 135 // Sent when the popup with Autofill suggestions for a form is shown. |
| 136 IPC_MESSAGE_ROUTED1(AutofillHostMsg_DidShowAutofillSuggestions, | 136 IPC_MESSAGE_ROUTED1(AutofillHostMsg_DidShowAutofillSuggestions, |
| 137 bool /* is this a new popup? */) | 137 bool /* is this a new popup? */) |
| 138 | 138 |
| 139 // Instructs the browser to fill in the values for a form using Autofill | 139 // Instructs the browser to fill in the values for a form using Autofill |
| 140 // profile data. | 140 // profile data. |
| 141 IPC_MESSAGE_ROUTED4(AutofillHostMsg_FillAutofillFormData, | 141 IPC_MESSAGE_ROUTED4(AutofillHostMsg_FillAutofillFormData, |
| 142 int /* id of this message */, | 142 int /* id of this message */, |
| 143 webkit_glue::FormData /* the form */, | 143 webkit::forms::FormData /* the form */, |
| 144 webkit_glue::FormField /* the form field */, | 144 webkit::forms::FormField /* the form field */, |
| 145 int /* profile unique ID */) | 145 int /* profile unique ID */) |
| 146 | 146 |
| 147 // Sent when a form is previewed with Autofill suggestions. | 147 // Sent when a form is previewed with Autofill suggestions. |
| 148 IPC_MESSAGE_ROUTED0(AutofillHostMsg_DidPreviewAutofillFormData) | 148 IPC_MESSAGE_ROUTED0(AutofillHostMsg_DidPreviewAutofillFormData) |
| 149 | 149 |
| 150 // Sent when a form is filled with Autofill suggestions. | 150 // Sent when a form is filled with Autofill suggestions. |
| 151 IPC_MESSAGE_ROUTED1(AutofillHostMsg_DidFillAutofillFormData, | 151 IPC_MESSAGE_ROUTED1(AutofillHostMsg_DidFillAutofillFormData, |
| 152 base::TimeTicks /* timestamp */) | 152 base::TimeTicks /* timestamp */) |
| 153 | 153 |
| 154 // Instructs the browser to remove the specified Autocomplete entry from the | 154 // Instructs the browser to remove the specified Autocomplete entry from the |
| 155 // database. | 155 // database. |
| 156 IPC_MESSAGE_ROUTED2(AutofillHostMsg_RemoveAutocompleteEntry, | 156 IPC_MESSAGE_ROUTED2(AutofillHostMsg_RemoveAutocompleteEntry, |
| 157 string16 /* field name */, | 157 string16 /* field name */, |
| 158 string16 /* value */) | 158 string16 /* value */) |
| 159 | 159 |
| 160 // Instructs the browser to show the Autofill dialog. | 160 // Instructs the browser to show the Autofill dialog. |
| 161 IPC_MESSAGE_ROUTED0(AutofillHostMsg_ShowAutofillDialog) | 161 IPC_MESSAGE_ROUTED0(AutofillHostMsg_ShowAutofillDialog) |
| 162 | 162 |
| 163 // Send when a text field is done editing. | 163 // Send when a text field is done editing. |
| 164 IPC_MESSAGE_ROUTED0(AutofillHostMsg_DidEndTextFieldEditing) | 164 IPC_MESSAGE_ROUTED0(AutofillHostMsg_DidEndTextFieldEditing) |
| 165 | 165 |
| 166 // Instructs the browser to hide the Autofill popup. | 166 // Instructs the browser to hide the Autofill popup. |
| 167 IPC_MESSAGE_ROUTED0(AutofillHostMsg_HideAutofillPopup) | 167 IPC_MESSAGE_ROUTED0(AutofillHostMsg_HideAutofillPopup) |
| OLD | NEW |