| // Copyright 2016 The Chromium Authors |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| module autofill.mojom; |
| |
| import "components/autofill/core/common/mojom/autofill_types.mojom"; |
| import "mojo/public/mojom/base/string16.mojom"; |
| import "mojo/public/mojom/base/text_direction.mojom"; |
| import "mojo/public/mojom/base/time.mojom"; |
| import "ui/gfx/geometry/mojom/geometry.mojom"; |
| import "url/mojom/url.mojom"; |
| |
| // There is one instance of this interface per RenderFrameHost in the browser |
| // process. All methods are called by renderer on browser. |
| interface AutofillDriver { |
| // Pushes a form the user interacted with from the AutofillAgent to the |
| // AutofillDriver, which may consider this form as a probably-submitted form |
| // once the page is navigated away from. If |form| is not set, it resets the |
| // last-interacted form. |
| SetFormToBeProbablySubmitted(FormData? form); |
| |
| // Notification that forms have been seen that are candidates for |
| // filling/submitting by the AutofillManager. |
| FormsSeen(array<FormData> updated_forms, array<FormRendererId> removed_forms); |
| |
| // Notification that a form has been submitted. The |known_success| indicates |
| // whether the submission succeeded or not. Currently, we assume submission |
| // succeeds if the form is removed. |
| FormSubmitted(FormData form, |
| bool known_success, |
| SubmissionSource source); |
| |
| // Notification that a form field's value has changed. |
| TextFieldDidChange(FormData form, |
| FormFieldData field, |
| gfx.mojom.RectF bounding_box, |
| mojo_base.mojom.TimeTicks timestamp); |
| |
| // Notification that a form field has scrolled. |
| TextFieldDidScroll(FormData form, |
| FormFieldData field, |
| gfx.mojom.RectF bounding_box); |
| |
| // Notification that a form select control has changed. |
| SelectControlDidChange(FormData form, |
| FormFieldData field, |
| gfx.mojom.RectF bounding_box); |
| |
| // Notification that a select element's options were modified. |
| SelectFieldOptionsDidChange(FormData form); |
| |
| // Queries the browser for Autofill suggestions for a form input field. |
| // For autofill this means asking the user which values to fill. |
| // |autoselect_first_suggestion| indicates whether a first suggestion gets |
| // auto selected. |form_element_was_clicked| indicates the user tapped an |
| // input element. When this happens, surfaces like Touch To Fill and Fast |
| // Checkout might be shown. |
| AskForValuesToFill(FormData form, |
| FormFieldData field, |
| gfx.mojom.RectF bounding_box, |
| AutoselectFirstSuggestion autoselect_first_suggestion, |
| FormElementWasClicked form_element_was_clicked); |
| |
| // Instructs the browser to hide the Autofill popup if it is open. |
| HidePopup(); |
| |
| // Sent when either (a) focus moves off of any form element, or (b) focus |
| // moves off of the form that the user had previously interacted with to a |
| // different form. |had_interacted_form| indicates whether there was such a |
| // previously-interacted form. |
| // TODO(crbug.com/1140473): Remove need to pass |had_interacted_form|. |
| FocusNoLongerOnForm(bool had_interacted_form); |
| |
| // Notification that a form field is focused. |
| FocusOnFormField(FormData form, |
| FormFieldData field, |
| gfx.mojom.RectF bounding_box); |
| |
| // Sent when a form is filled with Autofill suggestions. |
| DidFillAutofillFormData(FormData form, mojo_base.mojom.TimeTicks timestamp); |
| |
| // Sent when a form is previewed with Autofill suggestions. |
| DidPreviewAutofillFormData(); |
| |
| // Sent when a text field is done editing. |
| DidEndTextFieldEditing(); |
| |
| // Sent when |field| was in autofilled state but JavaScript modified the |
| // value. Note that from a renderer's perspective, modifying the value with |
| // JavaScript leads to a state where the field is not considered autofilled |
| // anymore. So this notification won't be sent again until the field gets |
| // autofilled again. |
| JavaScriptChangedAutofilledValue(FormData form, |
| FormFieldData field, |
| mojo_base.mojom.String16 old_value); |
| }; |
| |
| // There is one instance of this interface per web contents in the browser |
| // process that handles all the frames. The motivation was to make the interface |
| // associated with PasswordGenerationDriver. |
| interface PasswordManagerDriver { |
| // Notification that password forms have been seen that are candidates for |
| // filling/submitting by the password manager. |
| PasswordFormsParsed(array<FormData> forms_data); |
| |
| // Notification that initial layout has occurred and the following password |
| // forms are visible on the page (e.g. not set to display:none.). |
| PasswordFormsRendered(array<FormData> visible_forms_data); |
| |
| // Notification that this password form was submitted by the user. |
| PasswordFormSubmitted(FormData form_data); |
| |
| // Notification that a user has modified a password field. This is fired both |
| // when typing new characters and deleting characters, so the password field |
| // in `form_data` may or may not be empty |
| InformAboutUserInput(FormData form_data); |
| |
| // Notification that a dynamic form submission was observed. This could be due |
| // to a same-document navigation, detaching a frame, or hiding / removing a |
| // form after an XHR. |
| DynamicFormSubmission(SubmissionIndicatorEvent submission_indication_event); |
| |
| // Notification that password form was cleared. This is used as a signal of |
| // a successful submission for change password forms. |
| PasswordFormCleared(FormData form_data); |
| |
| // Sends |log| to browser for displaying to the user. Only strings passed as |
| // an argument to methods overriding SavePasswordProgressLogger::SendLog may |
| // become |log|, because those are guaranteed to be sanitized. |
| // Never pass a free-form string as |log|. |
| RecordSavePasswordProgress(string log); |
| |
| // Notification that the user (not JavaScript) modified the value of a |
| // password field. |
| UserModifiedPasswordField(); |
| |
| // Notification that the user (not JavaScript) modified the value of a |
| // non-password field with |renderer_id|, and |value| is the current value. |
| UserModifiedNonPasswordField( |
| FieldRendererId renderer_id, |
| mojo_base.mojom.String16 field_name, |
| mojo_base.mojom.String16 value, |
| bool autocomplete_attribute_has_username); |
| |
| // Instructs the browser to show a popup with password suggestions. The popup |
| // will use |text_direction| for displaying text. |
| ShowPasswordSuggestions(mojo_base.mojom.TextDirection text_direction, |
| mojo_base.mojom.String16 typed_username, |
| int32 options, gfx.mojom.RectF bounds); |
| |
| // Instructs the browser to show a keyboard replacing surface (e.g. |
| // TouchToFill) and whether the form is ready for submission after filling. |
| [EnableIf=is_android] |
| ShowKeyboardReplacingSurface(SubmissionReadinessState submission_readiness); |
| |
| // Checks the safe browsing reputation of the website where the focused |
| // username/password field is on. |
| CheckSafeBrowsingReputation( |
| url.mojom.Url form_action, url.mojom.Url frame_url); |
| |
| // The focus changed to a different input in the same frame (e.g. tabbed from |
| // email to password field). |
| FocusedInputChanged(FieldRendererId focused_field_id, |
| FocusedFieldType focused_field_type); |
| |
| // Sends the success state of filling credentials into a form. This happens |
| // only if the form being filled has a renderer_id. |result| is an |
| // integer serialization of autofill::FillingResult. It is passed as an |
| // integer as no further interpretation of the value is necessary in the |
| // browser. |
| LogFirstFillingResult(FormRendererId form_renderer_id, int32 result); |
| }; |
| |
| // There is one instance of this interface per web contents in the browser |
| // process. |
| interface PasswordGenerationDriver { |
| // Notifies the browser when automatic generation becomes available |
| // and provides data needed by the UI. |
| AutomaticGenerationAvailable( |
| PasswordGenerationUIData password_generation_ui_data); |
| |
| // Instructs the browser to show the popup for editing a generated password. |
| // The location should be specified in the renderers coordinate system. Form |
| // is the form associated with the password field. |field_renderer_id| is the |
| // ID of the password field triggering generation. |
| ShowPasswordEditingPopup( |
| gfx.mojom.RectF bounds, |
| FormData form_data, |
| FieldRendererId field_renderer_id, |
| mojo_base.mojom.String16 password_value); |
| |
| // Informs the browser that the password generation option was rejected |
| // by the user typing more characters than the maximum offer size into the |
| // password field. |
| PasswordGenerationRejectedByTyping(); |
| |
| // Instructs the browser to presave the form with generated password. |
| PresaveGeneratedPassword(FormData form_data, |
| mojo_base.mojom.String16 password_value); |
| |
| // Instructs the browser that form no longer contains a generated password and |
| // the presaved form should be removed. |
| PasswordNoLongerGenerated(FormData form_data); |
| |
| // Communicates to the browser that a scroll event happened on the frame. This |
| // event affects the password generation popup position. |
| FrameWasScrolled(); |
| |
| // Informs the browser that the generation element lost focus, so the browser |
| // might hide the generation popup. |
| GenerationElementLostFocus(); |
| }; |