@@ -118,17 +118,20 @@ class AutofillTelemetryBase {
118
118
this . recordGleanFormEvent ( "formPopupShown" , flowId , extra ) ;
119
119
}
120
120
121
- recordFormFilled ( flowId , fieldDetails , data ) {
121
+ setUpFormFilledExtra ( fieldDetails , data ) {
122
122
// Calculate values for telemetry
123
123
const extra = this . #initFormEventExtra( "unavailable" ) ;
124
124
125
125
for ( const fieldDetail of fieldDetails ) {
126
126
// It is possible that we don't autofill a field because it is cross-origin.
127
127
// When that happens, the data will not include that element.
128
- let { filledState, filledValue } = data . get ( fieldDetail . elementId ) ?? { } ;
128
+ let { filledState, filledValue, isFilledOnFieldsUpdate } =
129
+ data . get ( fieldDetail . elementId ) ?? { } ;
129
130
switch ( filledState ) {
130
131
case FIELD_STATES . AUTO_FILLED :
131
- filledState = "filled" ;
132
+ filledState = isFilledOnFieldsUpdate
133
+ ? "filled_on_fields_update"
134
+ : "filled" ;
132
135
break ;
133
136
case FIELD_STATES . NORMAL :
134
137
default :
@@ -140,11 +143,20 @@ class AutofillTelemetryBase {
140
143
}
141
144
this . #setFormEventExtra( extra , fieldDetail . fieldName , filledState ) ;
142
145
}
146
+ return extra ;
147
+ }
143
148
149
+ recordFormFilled ( flowId , fieldDetails , data ) {
150
+ const extra = this . setUpFormFilledExtra ( fieldDetails , data ) ;
144
151
this . recordFormEvent ( "filled" , flowId , extra ) ;
145
152
this . recordGleanFormEvent ( "formFilled" , flowId , extra ) ;
146
153
}
147
154
155
+ recordFormFilledOnFieldsUpdate ( flowId , fieldDetails , data ) {
156
+ const extra = this . setUpFormFilledExtra ( fieldDetails , data ) ;
157
+ this . recordFormEvent ( "filled_on_fields_update" , flowId , extra ) ;
158
+ }
159
+
148
160
recordFilledModified ( flowId , fieldDetails ) {
149
161
const extra = { field_name : fieldDetails [ 0 ] . fieldName } ;
150
162
this . recordFormEvent ( "filled_modified" , flowId , extra ) ;
@@ -203,6 +215,8 @@ class AutofillTelemetryBase {
203
215
return this . recordPopupShown ( flowId , fieldDetails ) ;
204
216
case "filled" :
205
217
return this . recordFormFilled ( flowId , fieldDetails , data ) ;
218
+ case "filled_on_fields_update" :
219
+ return this . recordFormFilledOnFieldsUpdate ( flowId , fieldDetails , data ) ;
206
220
case "filled_modified" :
207
221
return this . recordFilledModified ( flowId , fieldDetails ) ;
208
222
case "submitted" :
@@ -288,7 +302,7 @@ export class AddressTelemetry extends AutofillTelemetryBase {
288
302
HISTOGRAM_PROFILE_NUM_USES = "AUTOFILL_PROFILE_NUM_USES" ;
289
303
HISTOGRAM_PROFILE_NUM_USES_KEY = "address" ;
290
304
291
- // Fields that are record in `address_form` and `address_form_ext` telemetry
305
+ // Fields that are recorded in `address_form` and `address_form_ext` telemetry
292
306
SUPPORTED_FIELDS = {
293
307
"street-address" : "street_address" ,
294
308
"address-line1" : "address_line1" ,
@@ -307,7 +321,7 @@ export class AddressTelemetry extends AutofillTelemetryBase {
307
321
tel : "tel" ,
308
322
} ;
309
323
310
- // Fields that are record in `address_form` event telemetry extra_keys
324
+ // Fields that are recorded in `address_form` event telemetry extra_keys
311
325
static SUPPORTED_FIELDS_IN_FORM = [
312
326
"street_address" ,
313
327
"address_line1" ,
@@ -319,7 +333,7 @@ export class AddressTelemetry extends AutofillTelemetryBase {
319
333
"country" ,
320
334
] ;
321
335
322
- // Fields that are record in `address_form_ext` event telemetry extra_keys
336
+ // Fields that are recorded in `address_form_ext` event telemetry extra_keys
323
337
static SUPPORTED_FIELDS_IN_FORM_EXT = [
324
338
"name" ,
325
339
"given_name" ,
0 commit comments