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
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
|
// Copyright 2019 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.
syntax = "proto2";
option optimize_for = LITE_RUNTIME;
option java_package = "org.chromium.chrome.browser.autofill_assistant.proto";
option java_multiple_files = true;
package autofill_assistant;
message ModelProto {
message ModelValue {
optional string identifier = 1;
optional ValueProto value = 2;
}
// Maps model identifiers to their values.
repeated ModelValue values = 1;
}
// Remember to update the comparison operator in |user_model.cc| when adding new
// fields.
message ValueProto {
oneof kind {
StringList strings = 1;
BooleanList booleans = 2;
IntList ints = 3;
UserActionList user_actions = 4;
DateList dates = 5;
CreditCardList credit_cards = 7;
ProfileList profiles = 8;
LoginOptionList login_options = 9;
CreditCardResponseProto credit_card_response = 10;
bytes server_payload = 12;
}
// If set to true, this value will not be sent to the backend. This flag is
// mostly used internally, to prevent certain values from leaving the device.
// Note that values derived from client_side_only values will inherit this
// property.
optional bool is_client_side_only = 6;
reserved 11;
}
message ValueReferenceProto {
oneof kind {
ValueProto value = 1;
string model_identifier = 2;
}
}
message StringList {
repeated string values = 1;
}
message BooleanList {
repeated bool values = 1;
}
message IntList {
repeated int32 values = 1;
}
message UserActionList {
repeated UserActionProto values = 1;
}
message DateList {
repeated DateProto values = 1;
}
message CreditCardList {
repeated AutofillCreditCardProto values = 1;
}
message ProfileList {
repeated AutofillProfileProto values = 1;
}
message LoginOptionList {
repeated LoginOptionProto values = 1;
}
// Next: 25
enum ProcessedActionStatusProto {
UNKNOWN_ACTION_STATUS = 0;
// Element could not be found.
ELEMENT_RESOLUTION_FAILED = 1;
// The action was applied successfully.
ACTION_APPLIED = 2;
// The action failed (generic error).
//
// This usually means that the client needs to be fixed: either the error
// should be assigned a more specific error code, or a bug in the client code
// needs to be fixed.
//
// ProcessedActionProto.UnexpectedErrorInfoProto contains more details.
OTHER_ACTION_STATUS = 3;
// The action failed to collect the requested user data.
COLLECT_USER_DATA_ERROR = 4;
// Server asked the client to execute an unknown or unsupported action.
UNSUPPORTED_ACTION = 5;
// The action decided to fallback to manual mode, stopping the script.
//
// This can happen:
// - if an autofill action or an update details action cancels the script,
// possibly, not necessarily, as a result of a user action.
// - if an interrupt explicitly stops the main script, for wait for dom
MANUAL_FALLBACK = 6;
// The WaitForDom action failed because an interrupt that ran during
// that action failed.
INTERRUPT_FAILED = 7;
// The script was canceled by the user, while it was running.
//
// This only report such events that happen while a script is running. It can
// affect any action. It is a signal that the action or script ran in an
// abnormal situation and its outcome cannot be trusted.
USER_ABORTED_ACTION = 8;
// The Autofill Action failed to get the full card information.
//
// Possible causes:
// - the user filled in the wrong CVC number.
// - the card has expired
GET_FULL_CARD_FAILED = 9;
// The action did not have what it needs. This is generally a bug in the
// script.
//
// This is currently returned by the autofill action, when it could not find
// the credit card or the address it needs in the client memory. This is
// usually the sign that the CollectUserDataAction was not run or failed.
PRECONDITION_FAILED = 10;
// The action definition returned by the server was rejected.
INVALID_ACTION = 11;
// Executing the action as defined is unsupported.
UNSUPPORTED = 12;
// Timed out waiting for the document to load.
TIMED_OUT = 13;
// Failed to get a stable position for the element, usually to click on it.
ELEMENT_UNSTABLE = 14;
// The value passed to the select option action does not exist in the element.
// This is usually a scripting error.
OPTION_VALUE_NOT_FOUND = 16;
// The client got an unexpected error from a JavaScript snippet executed
// through devtools. This means that there's a bug in the client code.
//
// ProcessedActionProto.UnexpectedErrorInfoProto contains more details.
UNEXPECTED_JS_ERROR = 17;
// There were more than one matching element in the DOM in a context where
// only one is supported. This is generally a scripting error: the selector is
// not specific enough.
TOO_MANY_ELEMENTS = 18;
// The browser failed to navigate to a new document for its main frame. Note
// that this doesn't include page load errors, which are reported as
// TIMED_OUT.
NAVIGATION_ERROR = 19;
// A selector included into the current action is invalid.
INVALID_SELECTOR = 20;
// The requested autofill info (e.g., Chrome password manager login) was not
// available. It might have been recently deleted.
AUTOFILL_INFO_NOT_AVAILABLE = 21;
// An unexpected error occurred during element resolution.
FRAME_HOST_NOT_FOUND = 22;
// Autofill could not fully fill the form as expected.
//
// Possible causes:
// - The fallback data was not available.
// - A field defined as required was empty after the action completed.
// - Filling a field resulted in error, e.g. the field was not found.
//
// ProcessedActionStatusProto.AutofillErrorInfoProto contains more details.
AUTOFILL_INCOMPLETE = 24;
// Evaluating a selector required considering too many candidates. Please
// generate more specific selectors. See SelectorProto::ProximityFilter.
TOO_MANY_CANDIDATES = 25;
// Evaluating the element did report an unexpected mismatch in either value
// or text.
ELEMENT_MISMATCH = 26;
// Another element covered the targeted element, when trying to click.
ELEMENT_NOT_ON_TOP = 27;
reserved 15, 23;
}
// A message to describe a chip.
message ChipProto {
// The type of the chip.
optional ChipType type = 1;
// The icon shown on the chip. Not required if text is set.
optional ChipIcon icon = 2;
// The text shown on the chip. Not required if icon is set.
optional string text = 3;
// Whether the chip is sticky. When the bottom sheet is configured with the
// ConfigureBottomSheetProto::PeekMode::HANDLE_HEADER peek mode and the
// sheet is minimized, the first sticky action will be displayed instead of
// the profile icon.
optional bool sticky = 4;
}
enum ChipType {
UNKNOWN_CHIP_TYPE = 0;
// Chip is a highlighted (blue) action chip.
HIGHLIGHTED_ACTION = 1;
// Chip is a normal action chip.
NORMAL_ACTION = 3;
// A cancel chip, which closes AA in a way that allows the user to undo.
//
// The action associated with the chip is only executed after enough time has
// passed that undo is not possible.
//
// The presence of this chip inhibit the addition of an implicit close or
// cancel button.
CANCEL_ACTION = 4;
// A close chip, which closes AA immediately.
//
// The presence of this chip inhibit the addition of an implicit close or
// cancel button. Otherwise, buttons of this type work and look like a
// NORMAL_ACTION.
CLOSE_ACTION = 5;
// Chip is a highlighted (blue) action chip.
//
// The presence of this chip inhibit the addition of an implicit close or
// cancel button. Otherwise, buttons of this type work and look like a
// HIGHLIGHTED_ACTION.
DONE_ACTION = 6;
// A "Send feedback" chip, which will show the feedback form when clicked.
//
// Note that when this is used inside a script, we will continue the script
// normally once the user has clicked the chip.
FEEDBACK_ACTION = 7;
reserved 2;
}
enum ChipIcon {
NO_ICON = 0;
// https://icons.googleplex.com/#icon=clear
ICON_CLEAR = 1;
// https://icons.googleplex.com/#icon=done
ICON_DONE = 2;
// https://icons.googleplex.com/#icon=refresh
ICON_REFRESH = 3;
// https://icons.googleplex.com/#icon=more_vert
ICON_OVERFLOW = 4;
}
// Defines a mapping to an Android Q direct action.
message DirectActionProto {
// Map to direct actions with the given names.
repeated string names = 1;
// Arguments to report as required for the direct action.
//
// This is included into the definition reported to the caller without being
// interpreted. Requirement is not enforced.
repeated string required_arguments = 2;
// Arguments to report as optional for the direct action.
//
// This is included into the definition reported to the caller without being
// interpreted.
repeated string optional_arguments = 3;
}
// An action that can be performed via the UI and/or via Direct Actions (in
// Android Q+).
message UserActionProto {
optional ChipProto chip = 1;
optional DirectActionProto direct_action = 2;
// A unique identifier for this user action.
optional string identifier = 3;
// Whether this action is enabled or not.
optional bool enabled = 4 [default = true];
}
message DateProto {
optional int64 year = 1;
// Month of the year in the range [1-12].
optional int32 month = 2;
// Day of the month in the range [1-31].
optional int32 day = 3;
}
message TimeProto {
// Hour in the range [0-23].
optional int32 hour = 1;
// Minute in the range [0-59].
optional int32 minute = 2;
// Second in the range [0-59].
optional int32 second = 3;
}
message DateTimeProto {
optional DateProto date = 1;
optional TimeProto time = 2;
}
message AutofillCreditCardProto {
// The GUID of the card.
optional string guid = 1;
}
message CreditCardResponseProto {
optional string network = 1;
}
message AutofillProfileProto {
// The GUID of the profile.
optional string guid = 1;
}
message LoginOptionProto {
optional string label = 1;
optional string sublabel = 2;
optional bytes payload = 3;
}
|