summaryrefslogtreecommitdiff
path: root/chromium/components/autofill/content/common/autofill_types.mojom
blob: f37fb144071b1cc95354c1fca4055675180d6f17 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
// 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/common/text_direction.mojom";
import "mojo/common/time.mojom";
import "url/mojo/origin.mojom";
import "url/mojo/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::Layout
enum PasswordFormLayout {
  LAYOUT_OTHER,
  LAYOUT_LOGIN_AND_SIGNUP
};

// 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::PasswordForm::SubmissionIndicatorEvent
enum PasswordFormSubmissionIndicatorEvent {
    NONE,
    HTML_FORM_SUBMISSION,
    SAME_DOCUMENT_NAVIGATION,
    XHR_SUCCEEDED,
    FRAME_DETACHED,
    MANUAL_SAVE,
    DOM_MUTATION_AFTER_XHR,
    PROVISIONALLY_SAVED_FORM_ON_START_PROVISIONAL_LOAD,
    FILLED_FORM_ON_START_PROVISIONAL_LOAD,
    FILLED_INPUT_ELEMENTS_ON_START_PROVISIONAL_LOAD,
    SUBMISSION_INDICATOR_EVENT_COUNT
};

// autofill::PasswordFormFieldPredictionType
enum PasswordFormFieldPredictionType {
  PREDICTION_USERNAME,
  PREDICTION_CURRENT_PASSWORD,
  PREDICTION_NEW_PASSWORD,
  PREDICTION_NOT_PASSWORD
};

// autofill::FormFieldData
struct FormFieldData {
  string label;
  string name;
  string id;
  string value;
  string form_control_type;
  string autocomplete_attribute;
  string placeholder;
  string css_classes;
  uint32 properties_mask;

  uint64 max_length;
  bool is_autofilled;
  CheckStatus check_status;
  bool is_focusable;
  bool should_autocomplete;
  RoleAttribute role;
  mojo.common.mojom.TextDirection text_direction;

  array<string> option_values;
  array<string> option_contents;
};

// autofill::FormData
struct FormData {
  string name;
  url.mojom.Url origin;
  url.mojom.Url action;
  bool is_form_tag;
  bool is_formless_checkout;
  array<FormFieldData> fields;
};

// autofill::FormFieldDataPredictions
struct FormFieldDataPredictions {
  FormFieldData field;
  string signature;
  string heuristic_type;
  string server_type;
  string overall_type;
  string parseable_name;
};

// autofill::FormDataPredictions
struct FormDataPredictions {
  FormData data;
  string signature;
  array<FormFieldDataPredictions> fields;
};

// autofill::PasswordAndRealm
struct PasswordAndRealm {
  string password;
  string realm;
};


// autofill::PasswordFormFillData
struct PasswordFormFillData {
  string name;
  url.mojom.Url origin;
  url.mojom.Url action;
  FormFieldData username_field;
  FormFieldData password_field;
  string preferred_realm;
  map<string, PasswordAndRealm> additional_logins;
  bool wait_for_username;
  bool is_possible_change_password_form;
};

// autofill::PasswordFormGenerationData
struct PasswordFormGenerationData {
  uint64 form_signature;
  uint32 field_signature;
  bool has_confirmation_field;
  uint32 confirmation_field_signature;
};

// autofill::PossibleUsernamePair
struct PossibleUsernamePair {
  string value;
  string 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;
  string submit_element;
  string username_element;
  bool username_marked_by_site;
  string username_value;
  array<PossibleUsernamePair> other_possible_usernames;
  array<string> all_possible_passwords;
  bool form_has_autofilled_value;
  string password_element;
  string password_value;
  bool password_value_is_default;
  string new_password_element;
  string new_password_value;
  bool new_password_value_is_default;
  bool new_password_marked_by_site;
  string confirmation_password_element;
  bool preferred;
  mojo.common.mojom.Time date_created;
  mojo.common.mojom.Time date_synced;
  bool blacklisted_by_user;
  PasswordFormType type;
  int32 times_used;
  FormData form_data;
  GenerationUploadStatus generation_upload_status;
  string display_name;
  url.mojom.Url icon_url;
  url.mojom.Origin federation_origin;
  bool skip_zero_click;
  PasswordFormLayout layout;
  bool was_parsed_using_autofill_predictions;
  bool is_public_suffix_match;
  bool is_affiliation_based_match;
  bool does_look_like_signup_form;
  PasswordFormSubmissionIndicatorEvent submission_event;
};

// 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;
};