Bug 1385201 - [Form Autofill] Rename "extensions.formautofill.experimental". r=MattN draft
authorLuke Chang <lchang@mozilla.com>
Fri, 28 Jul 2017 15:50:48 +0800
changeset 617292 8497e49957f189a979098bec025ce27766ceed9b
parent 617159 556f19ef392ac2d9aac579864e2179d6c1d464e8
child 639788 fbe1626d83d20e957240c8ce35092592f4c48085
push id71023
push userbmo:lchang@mozilla.com
push dateFri, 28 Jul 2017 09:55:08 +0000
reviewersMattN
bugs1385201
milestone56.0a1
Bug 1385201 - [Form Autofill] Rename "extensions.formautofill.experimental". r=MattN MozReview-Commit-ID: 8SRu5PoQcMO
browser/app/profile/firefox.js
browser/extensions/formautofill/bootstrap.js
browser/extensions/formautofill/test/unit/head.js
testing/profiles/prefs_general.js
--- a/browser/app/profile/firefox.js
+++ b/browser/app/profile/firefox.js
@@ -1694,20 +1694,22 @@ pref("browser.crashReports.unsubmittedCh
 // chancesUntilSuppress is how many times we'll show the unsubmitted
 // crash report notification across different days and shutdown
 // without a user choice before we suppress the notification for
 // some number of days.
 pref("browser.crashReports.unsubmittedCheck.chancesUntilSuppress", 4);
 pref("browser.crashReports.unsubmittedCheck.autoSubmit", false);
 
 // Preferences for the form autofill system extension
+// The value of "extensions.formautofill.available" can be "on", "off" and "detect".
+// The "detect" means it's enabled if conditions defined in the extension are met.
 #ifdef NIGHTLY_BUILD
-pref("extensions.formautofill.experimental", true);
+pref("extensions.formautofill.available", "on");
 #else
-pref("extensions.formautofill.experimental", false);
+pref("extensions.formautofill.available", "detect");
 #endif
 pref("extensions.formautofill.addresses.enabled", true);
 pref("extensions.formautofill.firstTimeUse", true);
 pref("extensions.formautofill.heuristics.enabled", true);
 pref("extensions.formautofill.loglevel", "Warn");
 
 // Whether or not to restore a session with lazy-browser tabs.
 pref("browser.sessionstore.restore_tabs_lazily", true);
--- a/browser/extensions/formautofill/bootstrap.js
+++ b/browser/extensions/formautofill/bootstrap.js
@@ -36,17 +36,17 @@ function onMaybeOpenPopup(evt) {
     // This window already has autofill stylesheets.
     return;
   }
 
   insertStyleSheet(domWindow, STYLESHEET_URI);
 }
 
 function startup() {
-  if (!Services.prefs.getBoolPref("extensions.formautofill.experimental")) {
+  if (Services.prefs.getStringPref("extensions.formautofill.available") != "on") {
     return;
   }
 
   // Listen for the autocomplete popup message to lazily append our stylesheet related to the popup.
   Services.mm.addMessageListener("FormAutoComplete:MaybeOpenPopup", onMaybeOpenPopup);
 
   let parent = new FormAutofillParent();
   parent.init().catch(Cu.reportError);
--- a/browser/extensions/formautofill/test/unit/head.js
+++ b/browser/extensions/formautofill/test/unit/head.js
@@ -196,19 +196,19 @@ function objectMatches(object, fields) {
       return false;
     }
     actual[key] = object[key];
   }
   return ObjectUtils.deepEqual(actual, fields);
 }
 
 add_task(async function head_initialize() {
-  Services.prefs.setBoolPref("extensions.formautofill.experimental", true);
+  Services.prefs.setStringPref("extensions.formautofill.available", "on");
   Services.prefs.setBoolPref("extensions.formautofill.heuristics.enabled", true);
   Services.prefs.setBoolPref("dom.forms.autocomplete.experimental", true);
 
   // Clean up after every test.
   do_register_cleanup(function head_cleanup() {
-    Services.prefs.clearUserPref("extensions.formautofill.experimental");
+    Services.prefs.clearUserPref("extensions.formautofill.available");
     Services.prefs.clearUserPref("extensions.formautofill.heuristics.enabled");
     Services.prefs.clearUserPref("dom.forms.autocomplete.experimental");
   });
 });
--- a/testing/profiles/prefs_general.js
+++ b/testing/profiles/prefs_general.js
@@ -374,17 +374,17 @@ user_pref("media.libavcodec.allow-obsole
 
 user_pref("media.openUnsupportedTypeWithExternalApp", false);
 
 // Disable password capture, so that mochitests that include forms aren't
 // influenced by the presence of the persistent doorhanger notification.
 user_pref("signon.rememberSignons", false);
 
 // Enable form autofill feature testing.
-user_pref("extensions.formautofill.experimental", true);
+user_pref("extensions.formautofill.available", "on");
 
 // Disable all recommended Marionette preferences for Gecko tests.
 // The prefs recommended by Marionette are typically geared towards
 // consumer automation; not vendor testing.
 user_pref("marionette.prefs.recommended", false);
 
 // Disable Screenshots by default for now
 user_pref("extensions.screenshots.system-disabled", true);