Bug 990200 - Part 2: Set probes in the form submission part. r?MattN draft
authorsteveck-chung <schung@mozilla.com>
Fri, 02 Jun 2017 11:49:54 +0800
changeset 611261 29246d127e5a40ccca533b58704ad05e01b65dfb
parent 611260 ff645328b423f7699d46b3b04df537af016b3734
child 638099 1689d96f3b75be038fffa0e3a1492763aabfe440
push id69153
push userbmo:schung@mozilla.com
push dateWed, 19 Jul 2017 09:44:34 +0000
reviewersMattN
bugs990200
milestone56.0a1
Bug 990200 - Part 2: Set probes in the form submission part. r?MattN MozReview-Commit-ID: H1BnxBxKg5K
browser/extensions/formautofill/FormAutofillParent.jsm
--- a/browser/extensions/formautofill/FormAutofillParent.jsm
+++ b/browser/extensions/formautofill/FormAutofillParent.jsm
@@ -294,19 +294,23 @@ FormAutofillParent.prototype = {
                 changedGUIDs.push(address.guid);
               } else {
                 this.profileStorage.addresses.remove(address.guid);
               }
               break;
           }
           changedGUIDs.forEach(guid => this.profileStorage.addresses.notifyUsed(guid));
         });
+        // Address should be updated
+        Services.telemetry.scalarAdd("formautofill.addresses.fill_type_autofill_update", 1);
         return;
       }
       this.profileStorage.addresses.notifyUsed(address.guid);
+      // Address is merged successfully
+      Services.telemetry.scalarAdd("formautofill.addresses.fill_type_autofill", 1);
     } else {
       let changedGUIDs = this.profileStorage.addresses.mergeToStorage(address.record);
       if (!changedGUIDs.length) {
         changedGUIDs.push(this.profileStorage.addresses.add(address.record));
       }
       changedGUIDs.forEach(guid => this.profileStorage.addresses.notifyUsed(guid));
 
       // Show first time use doorhanger
@@ -315,12 +319,15 @@ FormAutofillParent.prototype = {
         FormAutofillDoorhanger.show(target, "firstTimeUse").then((state) => {
           if (state !== "open-pref") {
             return;
           }
 
           target.ownerGlobal.openPreferences("panePrivacy",
                                              {origin: "autofillDoorhanger"});
         });
+      } else {
+        // We want to exclude the first time form filling.
+        Services.telemetry.scalarAdd("formautofill.addresses.fill_type_manual", 1);
       }
     }
   },
 };