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