Bug 1358097 - Add Screenshots to the navbar placements for Customizable UI when Screenshots is enabled. r?Gijs draft
authorMark Banner <standard8@mozilla.com>
Thu, 20 Apr 2017 20:50:13 +0100
changeset 566085 3badcdf80286fd1210dc92b5a85c14383ae56386
parent 565673 f6be27f5457ffd75b3763db09a139e24bc2155dc
child 625189 0bba3301b21cf86f5a0fc08ab4ad76c35b24f3e3
push id55078
push userbmo:standard8@mozilla.com
push dateThu, 20 Apr 2017 20:08:33 +0000
reviewersGijs
bugs1358097
milestone55.0a1
Bug 1358097 - Add Screenshots to the navbar placements for Customizable UI when Screenshots is enabled. r?Gijs MozReview-Commit-ID: 3ZEFZZhqt6s
browser/components/customizableui/CustomizableUI.jsm
--- a/browser/components/customizableui/CustomizableUI.jsm
+++ b/browser/components/customizableui/CustomizableUI.jsm
@@ -252,16 +252,24 @@ var CustomizableUIInternal = {
 
     // Place this last, when createWidget is called for pocket, it will
     // append to the toolbar.
     if (Services.prefs.getPrefType("extensions.pocket.enabled") != Services.prefs.PREF_INVALID &&
         Services.prefs.getBoolPref("extensions.pocket.enabled")) {
         navbarPlacements.push("pocket-button");
     }
 
+    // Firefox Screenshots is a WebExtension, and WebExtensions place buttons
+    // at the end of the toolbar. Apparently this happens after pocket's
+    // createWidget call (see previous comment).
+    if (!Services.prefs.getBoolPref("extensions.screenshots.disabled", false) &&
+        !Services.prefs.getBoolPref("extensions.screenshots.system-disabled", false)) {
+      navbarPlacements.push("screenshots_mozilla_org-browser-action");
+    }
+
     this.registerArea(CustomizableUI.AREA_NAVBAR, {
       legacy: true,
       type: CustomizableUI.TYPE_TOOLBAR,
       overflowable: true,
       defaultPlacements: navbarPlacements,
       defaultCollapsed: false,
     }, true);