naiveproxy/components/autofill/content/common/autofill_driver.mojom
2018-01-28 13:32:06 -05:00

176 lines
7.5 KiB
Plaintext

// 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/common/string16.mojom";
import "mojo/common/text_direction.mojom";
import "mojo/common/time.mojom";
import "ui/gfx/geometry/mojo/geometry.mojom";
import "url/mojo/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<FormData> forms, mojo.common.mojom.TimeTicks timestamp);
// Notification that a form is about to be submitted. The user hit the button.
WillSubmitForm(FormData form, mojo.common.mojom.TimeTicks timestamp);
// Notification that a form has been submitted.
FormSubmitted(FormData form);
// Notification that a form field's value has changed.
TextFieldDidChange(FormData form,
FormFieldData field,
gfx.mojom.RectF bounding_box,
mojo.common.mojom.TimeTicks timestamp);
// Notification that a form field has scrolled.
TextFieldDidScroll(FormData form,
FormFieldData field,
gfx.mojom.RectF bounding_box);
// 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);
// 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.common.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<mojo.common.mojom.String16> values,
array<mojo.common.mojom.String16> 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<PasswordForm> 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<PasswordForm> 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 in-page navigation happened and at this moment we have
// filled password form. We use this as a signal for successful login.
InPageNavigation(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.common.mojom.TextDirection text_direction,
mojo.common.mojom.String16 typed_username,
int32 options, gfx.mojom.RectF bounds);
// Instructs the browser to show a popup with a warning that the form
// is not secure. The popup will use |text_direction| for displaying
// text. This popup is shown when a password form on a non-secure page is
// autofilled on page load.
ShowNotSecureWarning(mojo.common.mojom.TextDirection text_direction,
gfx.mojom.RectF bounds);
// Instructs the browser to show a suggestion, which will redirect the user to
// the list of all saved passwords. The popup will use |text_direction| for
// displaying text.
ShowManualFallbackSuggestion(mojo.common.mojom.TextDirection text_direction,
gfx.mojom.RectF bounds);
// 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);
// Sends the outcome of HTML parsing based form classifier that detects the
// forms where password generation should be available.
SaveGenerationFieldDetectedByClassifier(
PasswordForm password_form, mojo.common.mojom.String16 generation_field);
// 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);
};
// 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);
// Instructs the browser to show the password generation popup at the
// specified location. This location should be specified in the renderers
// coordinate system. Form is the form associated with the password field.
// The popup will be anchored at |bounds|. The generated password
// will be no longer than |max_length|. |generation_element| should contain a
// name of a password field at which generation popup is attached.
// |is_manually_triggered| informs whether it is automatically or manually
// triggered generation.
ShowPasswordGenerationPopup(
gfx.mojom.RectF bounds, int32 max_length,
mojo.common.mojom.String16 generation_element, bool is_manually_triggered,
PasswordForm password_form);
// 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);
// Instructs the browser to hide any password generation popups.
HidePasswordGenerationPopup();
};