| 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 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 | 110 |
| 111 // IPC_MESSAGE macros fail on the std::map, when expanding. We need to define | 111 // IPC_MESSAGE macros fail on the std::map, when expanding. We need to define |
| 112 // a type to avoid that. | 112 // a type to avoid that. |
| 113 using FormsPredictionsMap = | 113 using FormsPredictionsMap = |
| 114 std::map<autofill::FormData, autofill::PasswordFormFieldPredictionMap>; | 114 std::map<autofill::FormData, autofill::PasswordFormFieldPredictionMap>; |
| 115 | 115 |
| 116 #endif // COMPONENTS_AUTOFILL_CONTENT_COMMON_AUTOFILL_MESSAGES_H_ | 116 #endif // COMPONENTS_AUTOFILL_CONTENT_COMMON_AUTOFILL_MESSAGES_H_ |
| 117 | 117 |
| 118 // Autofill messages sent from the browser to the renderer. | 118 // Autofill messages sent from the browser to the renderer. |
| 119 | 119 |
| 120 // Instructs the renderer to fill the active form with the given form data. | |
| 121 IPC_MESSAGE_ROUTED2(AutofillMsg_FillForm, | |
| 122 int /* query_id */, | |
| 123 autofill::FormData /* form */) | |
| 124 | |
| 125 // Instructs the renderer to preview the active form with the given form data. | |
| 126 IPC_MESSAGE_ROUTED2(AutofillMsg_PreviewForm, | |
| 127 int /* query_id */, | |
| 128 autofill::FormData /* form */) | |
| 129 | |
| 130 // Fill a password form and prepare field autocomplete for multiple | 120 // Fill a password form and prepare field autocomplete for multiple |
| 131 // matching logins. Lets the renderer know if it should disable the popup | 121 // matching logins. Lets the renderer know if it should disable the popup |
| 132 // because the browser process will own the popup UI. |key| serves for | 122 // because the browser process will own the popup UI. |key| serves for |
| 133 // identifying the fill form data in subsequent | 123 // identifying the fill form data in subsequent |
| 134 // AutofillHostMsg_ShowPasswordSuggestions messages to the browser. | 124 // AutofillHostMsg_ShowPasswordSuggestions messages to the browser. |
| 135 IPC_MESSAGE_ROUTED2(AutofillMsg_FillPasswordForm, | 125 IPC_MESSAGE_ROUTED2(AutofillMsg_FillPasswordForm, |
| 136 int /* key */, | 126 int /* key */, |
| 137 autofill::PasswordFormFillData /* the fill form data*/) | 127 autofill::PasswordFormFillData /* the fill form data*/) |
| 138 | 128 |
| 139 // Notification to start (|active| == true) or stop (|active| == false) logging | 129 // Notification to start (|active| == true) or stop (|active| == false) logging |
| 140 // the decisions made about saving the password. | 130 // the decisions made about saving the password. |
| 141 IPC_MESSAGE_ROUTED1(AutofillMsg_SetLoggingState, bool /* active */) | 131 IPC_MESSAGE_ROUTED1(AutofillMsg_SetLoggingState, bool /* active */) |
| 142 | 132 |
| 143 // Send the heuristic and server field type predictions to the renderer. | |
| 144 IPC_MESSAGE_ROUTED1( | |
| 145 AutofillMsg_FieldTypePredictionsAvailable, | |
| 146 std::vector<autofill::FormDataPredictions> /* forms */) | |
| 147 | |
| 148 // Clears the currently displayed Autofill results. | |
| 149 IPC_MESSAGE_ROUTED0(AutofillMsg_ClearForm) | |
| 150 | |
| 151 // Tells the renderer that the Autofill previewed form should be cleared. | |
| 152 IPC_MESSAGE_ROUTED0(AutofillMsg_ClearPreviewedForm) | |
| 153 | |
| 154 // Sets the currently selected node's value. | |
| 155 IPC_MESSAGE_ROUTED1(AutofillMsg_FillFieldWithValue, | |
| 156 base::string16 /* value */) | |
| 157 | |
| 158 // Sets the suggested value for the currently previewed node. | |
| 159 IPC_MESSAGE_ROUTED1(AutofillMsg_PreviewFieldWithValue, | |
| 160 base::string16 /* value */) | |
| 161 | |
| 162 // Sets the currently selected node's value to be the given data list value. | |
| 163 IPC_MESSAGE_ROUTED1(AutofillMsg_AcceptDataListSuggestion, | |
| 164 base::string16 /* accepted data list value */) | |
| 165 | |
| 166 // Tells the renderer to populate the correct password fields with this | 133 // Tells the renderer to populate the correct password fields with this |
| 167 // generated password. | 134 // generated password. |
| 168 IPC_MESSAGE_ROUTED1(AutofillMsg_GeneratedPasswordAccepted, | 135 IPC_MESSAGE_ROUTED1(AutofillMsg_GeneratedPasswordAccepted, |
| 169 base::string16 /* generated_password */) | 136 base::string16 /* generated_password */) |
| 170 | 137 |
| 171 // Tells the renderer to enable the form classifier. | 138 // Tells the renderer to enable the form classifier. |
| 172 IPC_MESSAGE_ROUTED0(AutofillMsg_AllowToRunFormClassifier) | 139 IPC_MESSAGE_ROUTED0(AutofillMsg_AllowToRunFormClassifier) |
| 173 | 140 |
| 174 // Tells the renderer to fill the username and password with with given | |
| 175 // values. | |
| 176 IPC_MESSAGE_ROUTED2(AutofillMsg_FillPasswordSuggestion, | |
| 177 base::string16 /* username */, | |
| 178 base::string16 /* password */) | |
| 179 | |
| 180 // Tells the renderer to preview the username and password with the given | |
| 181 // values. | |
| 182 IPC_MESSAGE_ROUTED2(AutofillMsg_PreviewPasswordSuggestion, | |
| 183 base::string16 /* username */, | |
| 184 base::string16 /* password */) | |
| 185 | |
| 186 // Sent when a password form is initially detected and suggestions should be | |
| 187 // shown. Used by the fill-on-select experiment. | |
| 188 IPC_MESSAGE_ROUTED2(AutofillMsg_ShowInitialPasswordAccountSuggestions, | |
| 189 int /* key */, | |
| 190 autofill::PasswordFormFillData /* the fill form data */) | |
| 191 | |
| 192 // Tells the renderer to find the focused password form (assuming it exists). | 141 // Tells the renderer to find the focused password form (assuming it exists). |
| 193 // Renderer is expected to respond with the message | 142 // Renderer is expected to respond with the message |
| 194 // |AutofillHostMsg_FocusedPasswordFormFound|. | 143 // |AutofillHostMsg_FocusedPasswordFormFound|. |
| 195 IPC_MESSAGE_ROUTED0(AutofillMsg_FindFocusedPasswordForm) | 144 IPC_MESSAGE_ROUTED0(AutofillMsg_FindFocusedPasswordForm) |
| 196 | 145 |
| 197 // Tells the renderer to find a focused element, and if it is a password field | 146 // Tells the renderer to find a focused element, and if it is a password field |
| 198 // eligible for generation then to trigger generation by responding to the | 147 // eligible for generation then to trigger generation by responding to the |
| 199 // browser with the message |AutofillHostMsg_ShowPasswordGenerationPopup|. | 148 // browser with the message |AutofillHostMsg_ShowPasswordGenerationPopup|. |
| 200 IPC_MESSAGE_ROUTED0(AutofillMsg_UserTriggeredGeneratePassword) | 149 IPC_MESSAGE_ROUTED0(AutofillMsg_UserTriggeredGeneratePassword) |
| 201 | 150 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 214 // which contains information about username and password fields for some forms. | 163 // which contains information about username and password fields for some forms. |
| 215 // |predictions| maps forms to their username fields. | 164 // |predictions| maps forms to their username fields. |
| 216 IPC_MESSAGE_ROUTED1(AutofillMsg_AutofillUsernameAndPasswordDataReceived, | 165 IPC_MESSAGE_ROUTED1(AutofillMsg_AutofillUsernameAndPasswordDataReceived, |
| 217 FormsPredictionsMap /* predictions */) | 166 FormsPredictionsMap /* predictions */) |
| 218 | 167 |
| 219 // Autofill messages sent from the renderer to the browser. | 168 // Autofill messages sent from the renderer to the browser. |
| 220 | 169 |
| 221 // TODO(creis): check in the browser that the renderer actually has permission | 170 // TODO(creis): check in the browser that the renderer actually has permission |
| 222 // for the URL to avoid compromised renderers talking to the browser. | 171 // for the URL to avoid compromised renderers talking to the browser. |
| 223 | 172 |
| 224 // Notification that forms have been seen that are candidates for | |
| 225 // filling/submitting by the AutofillManager. | |
| 226 IPC_MESSAGE_ROUTED2(AutofillHostMsg_FormsSeen, | |
| 227 std::vector<autofill::FormData> /* forms */, | |
| 228 base::TimeTicks /* timestamp */) | |
| 229 | |
| 230 // Notification that password forms have been seen that are candidates for | 173 // Notification that password forms have been seen that are candidates for |
| 231 // filling/submitting by the password manager. | 174 // filling/submitting by the password manager. |
| 232 IPC_MESSAGE_ROUTED1(AutofillHostMsg_PasswordFormsParsed, | 175 IPC_MESSAGE_ROUTED1(AutofillHostMsg_PasswordFormsParsed, |
| 233 std::vector<autofill::PasswordForm> /* forms */) | 176 std::vector<autofill::PasswordForm> /* forms */) |
| 234 | 177 |
| 235 // Notification that initial layout has occurred and the following password | 178 // Notification that initial layout has occurred and the following password |
| 236 // forms are visible on the page (e.g. not set to display:none.), and whether | 179 // forms are visible on the page (e.g. not set to display:none.), and whether |
| 237 // all frames in the page have been rendered. | 180 // all frames in the page have been rendered. |
| 238 IPC_MESSAGE_ROUTED2(AutofillHostMsg_PasswordFormsRendered, | 181 IPC_MESSAGE_ROUTED2(AutofillHostMsg_PasswordFormsRendered, |
| 239 std::vector<autofill::PasswordForm> /* forms */, | 182 std::vector<autofill::PasswordForm> /* forms */, |
| (...skipping 13 matching lines...) Expand all Loading... |
| 253 IPC_MESSAGE_ROUTED1(AutofillHostMsg_InPageNavigation, | 196 IPC_MESSAGE_ROUTED1(AutofillHostMsg_InPageNavigation, |
| 254 autofill::PasswordForm /* form */) | 197 autofill::PasswordForm /* form */) |
| 255 | 198 |
| 256 // Sends |log| to browser for displaying to the user. Only strings passed as an | 199 // Sends |log| to browser for displaying to the user. Only strings passed as an |
| 257 // argument to methods overriding SavePasswordProgressLogger::SendLog may become | 200 // argument to methods overriding SavePasswordProgressLogger::SendLog may become |
| 258 // |log|, because those are guaranteed to be sanitized. Never pass a free-form | 201 // |log|, because those are guaranteed to be sanitized. Never pass a free-form |
| 259 // string as |log|. | 202 // string as |log|. |
| 260 IPC_MESSAGE_ROUTED1(AutofillHostMsg_RecordSavePasswordProgress, | 203 IPC_MESSAGE_ROUTED1(AutofillHostMsg_RecordSavePasswordProgress, |
| 261 std::string /* log */) | 204 std::string /* log */) |
| 262 | 205 |
| 263 // Notification that a form is about to be submitted. The user hit the button. | |
| 264 IPC_MESSAGE_ROUTED2(AutofillHostMsg_WillSubmitForm, | |
| 265 autofill::FormData /* form */, | |
| 266 base::TimeTicks /* timestamp */) | |
| 267 | |
| 268 // Notification that a form has been submitted. | |
| 269 IPC_MESSAGE_ROUTED1(AutofillHostMsg_FormSubmitted, | |
| 270 autofill::FormData /* form */) | |
| 271 | |
| 272 // Notification that a form field's value has changed. | |
| 273 IPC_MESSAGE_ROUTED3(AutofillHostMsg_TextFieldDidChange, | |
| 274 autofill::FormData /* the form */, | |
| 275 autofill::FormFieldData /* the form field */, | |
| 276 base::TimeTicks /* timestamp */) | |
| 277 | |
| 278 // Queries the browser for Autofill suggestions for a form input field. | 206 // Queries the browser for Autofill suggestions for a form input field. |
| 279 IPC_MESSAGE_ROUTED4(AutofillHostMsg_QueryFormFieldAutofill, | 207 IPC_MESSAGE_ROUTED4(AutofillHostMsg_QueryFormFieldAutofill, |
| 280 int /* id of this message */, | 208 int /* id of this message */, |
| 281 autofill::FormData /* the form */, | 209 autofill::FormData /* the form */, |
| 282 autofill::FormFieldData /* the form field */, | 210 autofill::FormFieldData /* the form field */, |
| 283 gfx::RectF /* input field bounds, window-relative */) | 211 gfx::RectF /* input field bounds, window-relative */) |
| 284 | 212 |
| 285 // Sent when a form is previewed with Autofill suggestions. | |
| 286 IPC_MESSAGE_ROUTED0(AutofillHostMsg_DidPreviewAutofillFormData) | |
| 287 | |
| 288 // Sent immediately after the renderer receives a ping IPC. | |
| 289 IPC_MESSAGE_ROUTED0(AutofillHostMsg_PingAck) | |
| 290 | |
| 291 // Sent when the current form is no longer focused. | |
| 292 IPC_MESSAGE_ROUTED0(AutofillHostMsg_FocusNoLongerOnForm) | |
| 293 | |
| 294 // Sent when a form is filled with Autofill suggestions. | |
| 295 IPC_MESSAGE_ROUTED2(AutofillHostMsg_DidFillAutofillFormData, | |
| 296 autofill::FormData /* the form */, | |
| 297 base::TimeTicks /* timestamp */) | |
| 298 | |
| 299 // Send when a text field is done editing. | |
| 300 IPC_MESSAGE_ROUTED0(AutofillHostMsg_DidEndTextFieldEditing) | |
| 301 | |
| 302 // Instructs the browser to hide the Autofill popup if it is open. | |
| 303 IPC_MESSAGE_ROUTED0(AutofillHostMsg_HidePopup) | |
| 304 | |
| 305 // Instructs the browser that generation is available for this particular form. | 213 // Instructs the browser that generation is available for this particular form. |
| 306 // This is used for UMA stats. | 214 // This is used for UMA stats. |
| 307 IPC_MESSAGE_ROUTED1(AutofillHostMsg_GenerationAvailableForForm, | 215 IPC_MESSAGE_ROUTED1(AutofillHostMsg_GenerationAvailableForForm, |
| 308 autofill::PasswordForm) | 216 autofill::PasswordForm) |
| 309 | 217 |
| 310 // Instructs the browser to show the password generation popup at the | 218 // Instructs the browser to show the password generation popup at the |
| 311 // specified location. This location should be specified in the renderers | 219 // specified location. This location should be specified in the renderers |
| 312 // coordinate system. Form is the form associated with the password field. | 220 // coordinate system. Form is the form associated with the password field. |
| 313 IPC_MESSAGE_ROUTED5(AutofillHostMsg_ShowPasswordGenerationPopup, | 221 IPC_MESSAGE_ROUTED5(AutofillHostMsg_ShowPasswordGenerationPopup, |
| 314 gfx::RectF /* source location */, | 222 gfx::RectF /* source location */, |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 346 // associated with |key|. The popup will use |text_direction| for displaying | 254 // associated with |key|. The popup will use |text_direction| for displaying |
| 347 // text. | 255 // text. |
| 348 IPC_MESSAGE_ROUTED5( | 256 IPC_MESSAGE_ROUTED5( |
| 349 AutofillHostMsg_ShowPasswordSuggestions, | 257 AutofillHostMsg_ShowPasswordSuggestions, |
| 350 int /* key */, | 258 int /* key */, |
| 351 base::i18n::TextDirection /* text_direction */, | 259 base::i18n::TextDirection /* text_direction */, |
| 352 base::string16 /* username typed by user */, | 260 base::string16 /* username typed by user */, |
| 353 int /* options bitmask of autofill::ShowPasswordSuggestionsOptions */, | 261 int /* options bitmask of autofill::ShowPasswordSuggestionsOptions */, |
| 354 gfx::RectF /* input field bounds, window-relative */) | 262 gfx::RectF /* input field bounds, window-relative */) |
| 355 | 263 |
| 356 // Inform browser of data list values for the curent field. | |
| 357 IPC_MESSAGE_ROUTED2(AutofillHostMsg_SetDataList, | |
| 358 std::vector<base::string16> /* values */, | |
| 359 std::vector<base::string16> /* labels */) | |
| 360 | |
| 361 // Inform the browser which password form is currently focused, as a response | 264 // Inform the browser which password form is currently focused, as a response |
| 362 // to the |AutofillMsg_FindFocusedPasswordForm| request. If no password form | 265 // to the |AutofillMsg_FindFocusedPasswordForm| request. If no password form |
| 363 // is focused, the response will contain an empty |autofill::PasswordForm|. | 266 // is focused, the response will contain an empty |autofill::PasswordForm|. |
| 364 IPC_MESSAGE_ROUTED1(AutofillHostMsg_FocusedPasswordFormFound, | 267 IPC_MESSAGE_ROUTED1(AutofillHostMsg_FocusedPasswordFormFound, |
| 365 autofill::PasswordForm) | 268 autofill::PasswordForm) |
| OLD | NEW |