| // 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 "mojo/public/mojom/base/text_direction.mojom"; |
| import "mojo/public/mojom/base/time.mojom"; |
| import "mojo/public/mojom/base/string16.mojom"; |
| import "ui/gfx/geometry/mojo/geometry.mojom"; |
| import "url/mojom/origin.mojom"; |
| import "url/mojom/url.mojom"; |
| |
| // autofill::FormFieldData::CheckStatus |
| enum CheckStatus { |
| NOT_CHECKABLE, |
| CHECKABLE_BUT_UNCHECKED, |
| CHECKED |
| }; |
| |
| // autofill::FormFieldData::RoleAttribute |
| enum RoleAttribute { |
| ROLE_ATTRIBUTE_PRESENTATION, |
| ROLE_ATTRIBUTE_OTHER |
| }; |
| |
| // autofill::PasswordForm::GenerationUploadStatus |
| enum GenerationUploadStatus { |
| NO_SIGNAL_SENT, |
| POSITIVE_SIGNAL_SENT, |
| NEGATIVE_SIGNAL_SENT, |
| UNKNOWN_STATUS = 10 |
| }; |
| |
| // autofill::PasswordForm::Type |
| enum PasswordFormType { |
| TYPE_MANUAL, |
| TYPE_GENERATED, |
| TYPE_API |
| }; |
| |
| // autofill::PasswordForm::Scheme |
| enum PasswordFormScheme { |
| SCHEME_HTML, |
| SCHEME_BASIC, |
| SCHEME_DIGEST, |
| SCHEME_OTHER, |
| SCHEME_USERNAME_ONLY |
| }; |
| |
| // autofill::SubmissionIndicatorEvent |
| enum SubmissionIndicatorEvent { |
| NONE, |
| HTML_FORM_SUBMISSION, |
| SAME_DOCUMENT_NAVIGATION, |
| XHR_SUCCEEDED, |
| FRAME_DETACHED, |
| DOM_MUTATION_AFTER_XHR, |
| PROVISIONALLY_SAVED_FORM_ON_START_PROVISIONAL_LOAD, |
| PROBABLE_FORM_SUBMISSION, |
| SUBMISSION_INDICATOR_EVENT_COUNT |
| }; |
| |
| // autofill::PasswordFormFieldPredictionType |
| enum PasswordFormFieldPredictionType { |
| PREDICTION_USERNAME, |
| PREDICTION_CURRENT_PASSWORD, |
| PREDICTION_NEW_PASSWORD, |
| PREDICTION_NOT_PASSWORD |
| }; |
| |
| // autofill::SubmissionSource |
| enum SubmissionSource { |
| NONE, |
| SAME_DOCUMENT_NAVIGATION, |
| XHR_SUCCEEDED, |
| FRAME_DETACHED, |
| DOM_MUTATION_AFTER_XHR, |
| PROBABLY_FORM_SUBMITTED, |
| FORM_SUBMISSION, |
| }; |
| |
| // autofill::FormFieldData::LabelSource |
| enum LabelSource { |
| UNKNOWN, |
| LABEL_TAG, |
| P_TAG, |
| DIV_TABLE, |
| TD_TAG, |
| DD_TAG, |
| LI_TAG, |
| PLACE_HOLDER, |
| ARIA_LABEL, |
| COMBINED, |
| VALUE, |
| }; |
| |
| // autofill::FillingStatus |
| enum FillingStatus { |
| SUCCESS, |
| ERROR_NO_VALID_FIELD, |
| ERROR_NOT_ALLOWED, |
| }; |
| |
| // autofill::ButtonTitleType |
| enum ButtonTitleType { |
| NONE, |
| BUTTON_ELEMENT_SUBMIT_TYPE, |
| BUTTON_ELEMENT_BUTTON_TYPE, |
| INPUT_ELEMENT_SUBMIT_TYPE, |
| INPUT_ELEMENT_BUTTON_TYPE, |
| HYPERLINK, |
| DIV, |
| SPAN |
| }; |
| |
| // autofill::FormFieldData |
| struct FormFieldData { |
| mojo_base.mojom.String16 label; |
| mojo_base.mojom.String16 name; |
| mojo_base.mojom.String16 id_attribute; |
| mojo_base.mojom.String16 name_attribute; |
| mojo_base.mojom.String16 value; |
| string form_control_type; |
| string autocomplete_attribute; |
| mojo_base.mojom.String16 placeholder; |
| mojo_base.mojom.String16 css_classes; |
| mojo_base.mojom.String16 aria_label; |
| mojo_base.mojom.String16 aria_description; |
| uint32 unique_renderer_id; |
| uint32 properties_mask; |
| |
| uint64 max_length; |
| bool is_autofilled; |
| string section; |
| CheckStatus check_status; |
| bool is_focusable; |
| bool should_autocomplete; |
| RoleAttribute role; |
| mojo_base.mojom.TextDirection text_direction; |
| bool is_enabled; |
| bool is_readonly; |
| mojo_base.mojom.String16 typed_value; |
| |
| array<mojo_base.mojom.String16> option_values; |
| array<mojo_base.mojom.String16> option_contents; |
| |
| LabelSource label_source; |
| }; |
| |
| struct ButtonTitleInfo { |
| mojo_base.mojom.String16 title; |
| ButtonTitleType type; |
| }; |
| |
| // autofill::FormData |
| struct FormData { |
| mojo_base.mojom.String16 id_attribute; |
| mojo_base.mojom.String16 name_attribute; |
| mojo_base.mojom.String16 name; |
| array<ButtonTitleInfo> button_titles; |
| // TODO(crbug.com/788181): Either change type to Origin or rename to URL. |
| url.mojom.Url origin; |
| url.mojom.Url action; |
| url.mojom.Origin main_frame_origin; |
| bool is_form_tag; |
| bool is_formless_checkout; |
| uint32 unique_renderer_id; |
| SubmissionIndicatorEvent submission_event; |
| array<FormFieldData> fields; |
| array<uint32> username_predictions; |
| }; |
| |
| // autofill::FormFieldDataPredictions |
| struct FormFieldDataPredictions { |
| FormFieldData field; |
| string signature; |
| string heuristic_type; |
| string server_type; |
| string overall_type; |
| string parseable_name; |
| string section; |
| }; |
| |
| // autofill::FormDataPredictions |
| struct FormDataPredictions { |
| FormData data; |
| string signature; |
| array<FormFieldDataPredictions> fields; |
| }; |
| |
| // autofill::PasswordAndRealm |
| struct PasswordAndRealm { |
| mojo_base.mojom.String16 password; |
| string realm; |
| }; |
| |
| // autofill::PasswordFormFillData |
| struct PasswordFormFillData { |
| uint32 form_renderer_id; |
| url.mojom.Url origin; |
| url.mojom.Url action; |
| FormFieldData username_field; |
| FormFieldData password_field; |
| bool username_may_use_prefilled_placeholder; |
| string preferred_realm; |
| map<mojo_base.mojom.String16, PasswordAndRealm> additional_logins; |
| bool wait_for_username; |
| bool has_renderer_ids; |
| }; |
| |
| // autofill::PasswordFormGenerationData |
| struct PasswordFormGenerationData { |
| uint64 form_signature; |
| uint32 field_signature; |
| bool has_confirmation_field; |
| uint32 confirmation_field_signature; |
| }; |
| |
| // autofill::NewPasswordFormGenerationData |
| struct NewPasswordFormGenerationData { |
| uint32 new_password_renderer_id; |
| uint32 confirmation_password_renderer_id; |
| }; |
| |
| // autofill::password_generation::PasswordGenerationUIData |
| struct PasswordGenerationUIData { |
| gfx.mojom.RectF bounds; |
| int32 max_length; |
| mojo_base.mojom.String16 generation_element; |
| mojo_base.mojom.TextDirection text_direction; |
| PasswordForm password_form; |
| }; |
| |
| // autofill::ValueElementPair |
| struct ValueElementPair { |
| mojo_base.mojom.String16 value; |
| mojo_base.mojom.String16 field_name; |
| }; |
| |
| // autofill::PasswordForm |
| struct PasswordForm { |
| PasswordFormScheme scheme; |
| string signon_realm; |
| url.mojom.Url origin_with_path; |
| url.mojom.Url action; |
| string affiliated_web_realm; |
| mojo_base.mojom.String16 submit_element; |
| mojo_base.mojom.String16 username_element; |
| bool username_marked_by_site; |
| mojo_base.mojom.String16 username_value; |
| array<ValueElementPair> other_possible_usernames; |
| array<ValueElementPair> all_possible_passwords; |
| bool form_has_autofilled_value; |
| mojo_base.mojom.String16 password_element; |
| mojo_base.mojom.String16 password_value; |
| mojo_base.mojom.String16 new_password_element; |
| mojo_base.mojom.String16 new_password_value; |
| bool new_password_marked_by_site; |
| mojo_base.mojom.String16 confirmation_password_element; |
| bool preferred; |
| mojo_base.mojom.Time date_created; |
| mojo_base.mojom.Time date_synced; |
| bool blacklisted_by_user; |
| PasswordFormType type; |
| int32 times_used; |
| FormData form_data; |
| GenerationUploadStatus generation_upload_status; |
| mojo_base.mojom.String16 display_name; |
| url.mojom.Url icon_url; |
| url.mojom.Origin federation_origin; |
| bool skip_zero_click; |
| bool was_parsed_using_autofill_predictions; |
| bool is_public_suffix_match; |
| bool is_affiliation_based_match; |
| SubmissionIndicatorEvent submission_event; |
| bool only_for_fallback_saving; |
| bool is_gaia_with_skip_save_password_form; |
| }; |
| |
| // TODO(leonhsl): Use map directly after http://crbug.com/628104 solved. |
| // autofill::PasswordFormFieldPredictionMap |
| // --> std::map<FormFieldData, PasswordFormFieldPredictionType> |
| struct PasswordFormFieldPredictionMap { |
| array<FormFieldData> keys; |
| array<PasswordFormFieldPredictionType> values; |
| }; |
| |
| // TODO(leonhsl): Use map directly after http://crbug.com/628104 solved. |
| // autofill::FormsPredictionsMap |
| // --> std::map<FormData, PasswordFormFieldPredictionMap> |
| struct FormsPredictionsMap { |
| array<FormData> keys; |
| array<PasswordFormFieldPredictionMap> values; |
| }; |