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 274683 c2ae95e45f9f63304c6ef40fa84a839aa35b8cdf
parent 274682 c3e5b8f5cf50ca16abd066db7bc3c7f591e928bd
child 274684 9b959bab2b04ed737c46ea0620912edfc489a943
push id863
push userraliiev@mozilla.com
push dateMon, 03 Aug 2015 13:22:43 +0000
treeherdermozilla-release@f6321b14228d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjaws, sledru
bugs1167096
milestone40.0a2
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
@@ -295,16 +295,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;