// Copyright 2016 The Chromium Authors. All rights reserved. // 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/content/common/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/mojo/geometry.mojom"; import "url/mojom/url.mojom"; // There is one instance of this interface per render frame host in the browser // process. All methods are called by renderer on browser. interface AutofillDriver { // Notification that forms have been seen that are candidates for // filling/submitting by the AutofillManager. FormsSeen(array forms, mojo_base.mojom.TimeTicks timestamp); // 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, mojo_base.mojom.TimeTicks timestamp); // 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. // |id| is the request ID which is used to map responses correctly. QueryFormFieldAutofill(int32 id, FormData form, FormFieldData field, gfx.mojom.RectF bounding_box, bool autoselect_first_suggestion); // Instructs the browser to hide the Autofill popup if it is open. HidePopup(); // Sent when the current form is no longer focused. FocusNoLongerOnForm(); // 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(); // Informs browser of data list values for the current field. SetDataList(array values, array labels); }; // There is one instance of this interface per render frame host in the browser // process. interface PasswordManagerDriver { // Notification that password forms have been seen that are candidates for // filling/submitting by the password manager. PasswordFormsParsed(array forms); // Notification that initial layout has occurred and the following password // forms are visible on the page (e.g. not set to display:none.), and whether // all frames in the page have been rendered. PasswordFormsRendered(array visible_forms, bool did_stop_loading); // Notification that this password form was submitted by the user. PasswordFormSubmitted(PasswordForm password_form); // Notification that a user starts typing in password fields and the omnibox // icon with anchored save/update prompt should be available. ShowManualFallbackForSaving(PasswordForm password_form); // Notification that there is no user input in password fields and the // save/update prompt anchored to the omnibox icon should be removed. HideManualFallbackForSaving(); // Notification that same-document navigation happened and at this moment we // have filled password form. We use this as a signal for successful login. SameDocumentNavigation(PasswordForm password_form); // 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(); // Instructs the browser to show a popup with suggestions filled from data // associated with |key|. The popup will use |text_direction| for displaying // text. ShowPasswordSuggestions(int32 key, mojo_base.mojom.TextDirection text_direction, mojo_base.mojom.String16 typed_username, int32 options, gfx.mojom.RectF bounds); // 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(bool is_fillable, bool is_password_field); }; // There is one instance of this interface per web contents in the browser // process. interface PasswordManagerClient { // Instructs the browser that generation is available for this particular // form. This is used for UMA stats. GenerationAvailableForForm(PasswordForm password_form); // Notifies the browser when automatic generation becomes available or // unavailable and provides data needed by the UI. AutomaticGenerationStatusChanged( bool available, PasswordGenerationUIData? password_generation_ui_data); // Instructs the browser to show the password generation popup for manual // generation and provides the data necessary to display it. // TODO(crbug.com/845458): Replace this with a method called from the browser // when user triggers generation manually which returns a boolean signaling // whether the state for generation could be saved or not. ShowManualPasswordGenerationPopup( 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. ShowPasswordEditingPopup(gfx.mojom.RectF bounds, PasswordForm password_form); // 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(PasswordForm password_form); // Instructs the browser that form no longer contains a generated password and // the presaved form should be removed. PasswordNoLongerGenerated(PasswordForm password_form); };