Bug 1167096 - Flip introductory prefs if there's no saved state. r=jaws, a=sledru
authorGijs Kruitbosch <gijskruitbosch@gmail.com>
Thu, 21 May 2015 14:09:55 +0100
changeset 260552 3ef925962765
parent 260551 a297bd71b81a
child 260553 b299cbea39e4
child 260555 79f9cd31b4b1
push id815
push userryanvm@gmail.com
push date2015-05-21 17:19 +0000
treeherdermozilla-release@3ef925962765 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjaws, sledru
bugs1167096
milestone38.0.5
Bug 1167096 - Flip introductory prefs if there's no saved state. r=jaws, a=sledru
browser/components/customizableui/CustomizableUI.jsm
--- a/browser/components/customizableui/CustomizableUI.jsm
+++ b/browser/components/customizableui/CustomizableUI.jsm
@@ -299,16 +299,23 @@ let CustomizableUIInternal = {
       this.createBuiltinWidget(widgetDefinition);
     }
   },
 
   _introduceNewBuiltinWidgets: function() {
     // We should still enter even if gSavedState.currentVersion >= kVersion
     // because the per-widget pref facility is independent of versioning.
     if (!gSavedState) {
+      // Flip all the prefs so we don't try to re-introduce later:
+      for (let [id, widget] of gPalette) {
+        if (widget.defaultArea && widget._introducedInVersion === "pref") {
+          let prefId = "browser.toolbarbuttons.introduced." + widget.id;
+          Services.prefs.setBoolPref(prefId, true);
+        }
+      }
       return;
     }
 
     let currentVersion = gSavedState.currentVersion;
     for (let [id, widget] of gPalette) {
       if (widget.defaultArea) {
         let shouldAdd = false;
         let shouldSetPref = false;