| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/time.h" | 9 #include "base/time/time.h" |
| 10 #include "components/autofill/core/common/autocheckout_status.h" | |
| 11 #include "components/autofill/core/common/form_data.h" | 10 #include "components/autofill/core/common/form_data.h" |
| 12 #include "components/autofill/core/common/form_data_predictions.h" | 11 #include "components/autofill/core/common/form_data_predictions.h" |
| 13 #include "components/autofill/core/common/form_field_data.h" | 12 #include "components/autofill/core/common/form_field_data.h" |
| 14 #include "components/autofill/core/common/form_field_data_predictions.h" | 13 #include "components/autofill/core/common/form_field_data_predictions.h" |
| 15 #include "components/autofill/core/common/forms_seen_state.h" | 14 #include "components/autofill/core/common/forms_seen_state.h" |
| 16 #include "components/autofill/core/common/password_form_fill_data.h" | 15 #include "components/autofill/core/common/password_form_fill_data.h" |
| 17 #include "components/autofill/core/common/web_element_descriptor.h" | 16 #include "components/autofill/core/common/web_element_descriptor.h" |
| 18 #include "content/public/common/common_param_traits.h" | 17 #include "content/public/common/common_param_traits.h" |
| 19 #include "content/public/common/common_param_traits_macros.h" | 18 #include "content/public/common/common_param_traits_macros.h" |
| 20 #include "content/public/common/password_form.h" | 19 #include "content/public/common/password_form.h" |
| 21 #include "ipc/ipc_message_macros.h" | 20 #include "ipc/ipc_message_macros.h" |
| 22 #include "ipc/ipc_message_utils.h" | 21 #include "ipc/ipc_message_utils.h" |
| 23 #include "third_party/WebKit/public/web/WebFormElement.h" | 22 #include "third_party/WebKit/public/web/WebFormElement.h" |
| 24 #include "ui/gfx/rect.h" | 23 #include "ui/gfx/rect.h" |
| 25 #include "url/gurl.h" | 24 #include "url/gurl.h" |
| 26 | 25 |
| 27 #define IPC_MESSAGE_START AutofillMsgStart | 26 #define IPC_MESSAGE_START AutofillMsgStart |
| 28 | 27 |
| 29 IPC_ENUM_TRAITS_MAX_VALUE(autofill::AutocheckoutStatus, | |
| 30 autofill::AUTOCHECKOUT_STATUS_NUM_STATUS - 1) | |
| 31 IPC_ENUM_TRAITS_MAX_VALUE(autofill::FormsSeenState, | 28 IPC_ENUM_TRAITS_MAX_VALUE(autofill::FormsSeenState, |
| 32 autofill::FORMS_SEEN_STATE_NUM_STATES - 1) | 29 autofill::FORMS_SEEN_STATE_NUM_STATES - 1) |
| 33 IPC_ENUM_TRAITS_MAX_VALUE(base::i18n::TextDirection, | 30 IPC_ENUM_TRAITS_MAX_VALUE(base::i18n::TextDirection, |
| 34 base::i18n::TEXT_DIRECTION_NUM_DIRECTIONS - 1) | 31 base::i18n::TEXT_DIRECTION_NUM_DIRECTIONS - 1) |
| 35 | 32 |
| 36 IPC_STRUCT_TRAITS_BEGIN(autofill::WebElementDescriptor) | 33 IPC_STRUCT_TRAITS_BEGIN(autofill::WebElementDescriptor) |
| 37 IPC_STRUCT_TRAITS_MEMBER(descriptor) | 34 IPC_STRUCT_TRAITS_MEMBER(descriptor) |
| 38 IPC_STRUCT_TRAITS_MEMBER(retrieval_method) | 35 IPC_STRUCT_TRAITS_MEMBER(retrieval_method) |
| 39 IPC_STRUCT_TRAITS_END() | 36 IPC_STRUCT_TRAITS_END() |
| 40 | 37 |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 IPC_STRUCT_TRAITS_MEMBER(password) | 96 IPC_STRUCT_TRAITS_MEMBER(password) |
| 100 IPC_STRUCT_TRAITS_MEMBER(realm) | 97 IPC_STRUCT_TRAITS_MEMBER(realm) |
| 101 IPC_STRUCT_TRAITS_END() | 98 IPC_STRUCT_TRAITS_END() |
| 102 | 99 |
| 103 IPC_ENUM_TRAITS_MAX_VALUE( | 100 IPC_ENUM_TRAITS_MAX_VALUE( |
| 104 WebKit::WebFormElement::AutocompleteResult, | 101 WebKit::WebFormElement::AutocompleteResult, |
| 105 WebKit::WebFormElement::AutocompleteResultErrorInvalid) | 102 WebKit::WebFormElement::AutocompleteResultErrorInvalid) |
| 106 | 103 |
| 107 // Autofill messages sent from the browser to the renderer. | 104 // Autofill messages sent from the browser to the renderer. |
| 108 | 105 |
| 109 // Request to parse all the forms without field count limit. | |
| 110 IPC_MESSAGE_ROUTED0(AutofillMsg_GetAllForms) | |
| 111 | |
| 112 // Reply to the AutofillHostMsg_FillAutofillFormData message with the | 106 // Reply to the AutofillHostMsg_FillAutofillFormData message with the |
| 113 // Autofill form data. | 107 // Autofill form data. |
| 114 IPC_MESSAGE_ROUTED2(AutofillMsg_FormDataFilled, | 108 IPC_MESSAGE_ROUTED2(AutofillMsg_FormDataFilled, |
| 115 int /* id of the request message */, | 109 int /* id of the request message */, |
| 116 autofill::FormData /* form data */) | 110 autofill::FormData /* form data */) |
| 117 | 111 |
| 118 // Fill a password form and prepare field autocomplete for multiple | 112 // Fill a password form and prepare field autocomplete for multiple |
| 119 // matching logins. Lets the renderer know if it should disable the popup | 113 // matching logins. Lets the renderer know if it should disable the popup |
| 120 // because the browser process will own the popup UI. | 114 // because the browser process will own the popup UI. |
| 121 IPC_MESSAGE_ROUTED1(AutofillMsg_FillPasswordForm, | 115 IPC_MESSAGE_ROUTED1(AutofillMsg_FillPasswordForm, |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 IPC_MESSAGE_ROUTED1(AutofillMsg_FormNotBlacklisted, | 158 IPC_MESSAGE_ROUTED1(AutofillMsg_FormNotBlacklisted, |
| 165 content::PasswordForm /* form checked */) | 159 content::PasswordForm /* form checked */) |
| 166 | 160 |
| 167 // Sent when requestAutocomplete() finishes (either succesfully or with an | 161 // Sent when requestAutocomplete() finishes (either succesfully or with an |
| 168 // error). If it was a success, the renderer fills the form that requested | 162 // error). If it was a success, the renderer fills the form that requested |
| 169 // autocomplete with the |form_data| values input by the user. | 163 // autocomplete with the |form_data| values input by the user. |
| 170 IPC_MESSAGE_ROUTED2(AutofillMsg_RequestAutocompleteResult, | 164 IPC_MESSAGE_ROUTED2(AutofillMsg_RequestAutocompleteResult, |
| 171 WebKit::WebFormElement::AutocompleteResult /* result */, | 165 WebKit::WebFormElement::AutocompleteResult /* result */, |
| 172 autofill::FormData /* form_data */) | 166 autofill::FormData /* form_data */) |
| 173 | 167 |
| 174 // Sent when a page should be filled using Autocheckout. This happens when the | |
| 175 // Autofill server hints that a page is Autocheckout enabled. | |
| 176 IPC_MESSAGE_ROUTED4(AutofillMsg_FillFormsAndClick, | |
| 177 std::vector<autofill::FormData> /* form_data */, | |
| 178 std::vector<autofill::WebElementDescriptor> /* | |
| 179 click_elements_before_form_fill */, | |
| 180 std::vector<autofill::WebElementDescriptor> /* | |
| 181 click_elements_after_form_fill */, | |
| 182 autofill::WebElementDescriptor /* element_descriptor */) | |
| 183 | |
| 184 // Sent when Autocheckout is supported for the current page. The page has to | |
| 185 // be whitelisted and the Autofill server must have returned Autocheckout page | |
| 186 // metadata. | |
| 187 IPC_MESSAGE_ROUTED0(AutofillMsg_AutocheckoutSupported) | |
| 188 | |
| 189 // Sent when the current page is actually displayed in the browser, possibly | 168 // Sent when the current page is actually displayed in the browser, possibly |
| 190 // after being preloaded. | 169 // after being preloaded. |
| 191 IPC_MESSAGE_ROUTED0(AutofillMsg_PageShown) | 170 IPC_MESSAGE_ROUTED0(AutofillMsg_PageShown) |
| 192 | 171 |
| 193 // Autofill messages sent from the renderer to the browser. | 172 // Autofill messages sent from the renderer to the browser. |
| 194 | 173 |
| 195 // TODO(creis): check in the browser that the renderer actually has permission | 174 // TODO(creis): check in the browser that the renderer actually has permission |
| 196 // for the URL to avoid compromised renderers talking to the browser. | 175 // for the URL to avoid compromised renderers talking to the browser. |
| 197 | 176 |
| 198 // Notification that forms have been seen that are candidates for | 177 // Notification that forms have been seen that are candidates for |
| (...skipping 21 matching lines...) Expand all Loading... |
| 220 IPC_MESSAGE_ROUTED2(AutofillHostMsg_FormSubmitted, | 199 IPC_MESSAGE_ROUTED2(AutofillHostMsg_FormSubmitted, |
| 221 autofill::FormData /* form */, | 200 autofill::FormData /* form */, |
| 222 base::TimeTicks /* timestamp */) | 201 base::TimeTicks /* timestamp */) |
| 223 | 202 |
| 224 // Notification that a form field's value has changed. | 203 // Notification that a form field's value has changed. |
| 225 IPC_MESSAGE_ROUTED3(AutofillHostMsg_TextFieldDidChange, | 204 IPC_MESSAGE_ROUTED3(AutofillHostMsg_TextFieldDidChange, |
| 226 autofill::FormData /* the form */, | 205 autofill::FormData /* the form */, |
| 227 autofill::FormFieldData /* the form field */, | 206 autofill::FormFieldData /* the form field */, |
| 228 base::TimeTicks /* timestamp */) | 207 base::TimeTicks /* timestamp */) |
| 229 | 208 |
| 230 // Shows the Autocheckout bubble if the conditions are right. | |
| 231 IPC_MESSAGE_ROUTED2(AutofillHostMsg_MaybeShowAutocheckoutBubble, | |
| 232 autofill::FormData /* form */, | |
| 233 gfx::RectF /* bounding_box */) | |
| 234 | |
| 235 // Queries the browser for Autofill suggestions for a form input field. | 209 // Queries the browser for Autofill suggestions for a form input field. |
| 236 IPC_MESSAGE_ROUTED5(AutofillHostMsg_QueryFormFieldAutofill, | 210 IPC_MESSAGE_ROUTED5(AutofillHostMsg_QueryFormFieldAutofill, |
| 237 int /* id of this message */, | 211 int /* id of this message */, |
| 238 autofill::FormData /* the form */, | 212 autofill::FormData /* the form */, |
| 239 autofill::FormFieldData /* the form field */, | 213 autofill::FormFieldData /* the form field */, |
| 240 gfx::RectF /* input field bounds, window-relative */, | 214 gfx::RectF /* input field bounds, window-relative */, |
| 241 bool /* display warning if autofill disabled */) | 215 bool /* display warning if autofill disabled */) |
| 242 | 216 |
| 243 // Instructs the browser to fill in the values for a form using Autofill | 217 // Instructs the browser to fill in the values for a form using Autofill |
| 244 // profile data. | 218 // profile data. |
| (...skipping 17 matching lines...) Expand all Loading... |
| 262 | 236 |
| 263 // Instructs the browser to show the Autofill dialog. | 237 // Instructs the browser to show the Autofill dialog. |
| 264 IPC_MESSAGE_ROUTED0(AutofillHostMsg_ShowAutofillDialog) | 238 IPC_MESSAGE_ROUTED0(AutofillHostMsg_ShowAutofillDialog) |
| 265 | 239 |
| 266 // Send when a text field is done editing. | 240 // Send when a text field is done editing. |
| 267 IPC_MESSAGE_ROUTED0(AutofillHostMsg_DidEndTextFieldEditing) | 241 IPC_MESSAGE_ROUTED0(AutofillHostMsg_DidEndTextFieldEditing) |
| 268 | 242 |
| 269 // Instructs the browser to hide the Autofill UI. | 243 // Instructs the browser to hide the Autofill UI. |
| 270 IPC_MESSAGE_ROUTED0(AutofillHostMsg_HideAutofillUI) | 244 IPC_MESSAGE_ROUTED0(AutofillHostMsg_HideAutofillUI) |
| 271 | 245 |
| 272 // Sent when the renderer filled an Autocheckout page and clicked the proceed | |
| 273 // button or if there was an error. | |
| 274 IPC_MESSAGE_ROUTED1(AutofillHostMsg_AutocheckoutPageCompleted, | |
| 275 autofill::AutocheckoutStatus /* status */) | |
| 276 | |
| 277 // Instructs the browser to show the password generation bubble at the | 246 // Instructs the browser to show the password generation bubble at the |
| 278 // specified location. This location should be specified in the renderers | 247 // specified location. This location should be specified in the renderers |
| 279 // coordinate system. Form is the form associated with the password field. | 248 // coordinate system. Form is the form associated with the password field. |
| 280 IPC_MESSAGE_ROUTED3(AutofillHostMsg_ShowPasswordGenerationPopup, | 249 IPC_MESSAGE_ROUTED3(AutofillHostMsg_ShowPasswordGenerationPopup, |
| 281 gfx::Rect /* source location */, | 250 gfx::Rect /* source location */, |
| 282 int /* max length of the password */, | 251 int /* max length of the password */, |
| 283 content::PasswordForm) | 252 content::PasswordForm) |
| 284 | 253 |
| 285 // Instruct the browser that a password mapping has been found for a field. | 254 // Instruct the browser that a password mapping has been found for a field. |
| 286 IPC_MESSAGE_ROUTED2(AutofillHostMsg_AddPasswordFormMapping, | 255 IPC_MESSAGE_ROUTED2(AutofillHostMsg_AddPasswordFormMapping, |
| 287 autofill::FormFieldData, /* the user name field */ | 256 autofill::FormFieldData, /* the user name field */ |
| 288 autofill::PasswordFormFillData /* password pairings */) | 257 autofill::PasswordFormFillData /* password pairings */) |
| 289 | 258 |
| 290 // Instruct the browser to show a popup with the following suggestions from the | 259 // Instruct the browser to show a popup with the following suggestions from the |
| 291 // password manager. | 260 // password manager. |
| 292 IPC_MESSAGE_ROUTED4(AutofillHostMsg_ShowPasswordSuggestions, | 261 IPC_MESSAGE_ROUTED4(AutofillHostMsg_ShowPasswordSuggestions, |
| 293 autofill::FormFieldData /* the form field */, | 262 autofill::FormFieldData /* the form field */, |
| 294 gfx::RectF /* input field bounds, window-relative */, | 263 gfx::RectF /* input field bounds, window-relative */, |
| 295 std::vector<base::string16> /* suggestions */, | 264 std::vector<base::string16> /* suggestions */, |
| 296 std::vector<base::string16> /* realms */) | 265 std::vector<base::string16> /* realms */) |
| 297 | 266 |
| 298 // Inform browser of data list values for the curent field. | 267 // Inform browser of data list values for the curent field. |
| 299 IPC_MESSAGE_ROUTED2(AutofillHostMsg_SetDataList, | 268 IPC_MESSAGE_ROUTED2(AutofillHostMsg_SetDataList, |
| 300 std::vector<base::string16> /* values */, | 269 std::vector<base::string16> /* values */, |
| 301 std::vector<base::string16> /* labels */) | 270 std::vector<base::string16> /* labels */) |
| OLD | NEW |