Bug 1248603 - Remove support of the appmenu from devtools. r=jryans
authorAlexandre Poirot <poirot.alex@gmail.com>
Fri, 01 Apr 2016 05:49:00 -0700
changeset 291388 836da2d40b19d6503e640897e7834ed36a8e8dab
parent 291387 d03f089bbab80cd36c4b0e82cbbaa1eebdb52528
child 291389 0b016f319532937405bf971cdb1e426e81bc35f5
push id19656
push usergwagner@mozilla.com
push dateMon, 04 Apr 2016 13:43:23 +0000
treeherderb2g-inbound@e99061fde28a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjryans
bugs1248603
milestone48.0a1
Bug 1248603 - Remove support of the appmenu from devtools. r=jryans
devtools/client/framework/browser-menus.js
--- a/devtools/client/framework/browser-menus.js
+++ b/devtools/client/framework/browser-menus.js
@@ -79,33 +79,28 @@ function createToolMenuElements(toolDefi
   bc.id = "devtoolsMenuBroadcaster_" + id;
   bc.setAttribute("label", toolDefinition.menuLabel || toolDefinition.label);
   bc.setAttribute("command", cmd.id);
 
   if (key) {
     bc.setAttribute("key", "key_" + id);
   }
 
-  let appmenuitem = doc.createElement("menuitem");
-  appmenuitem.id = "appmenuitem_" + id;
-  appmenuitem.setAttribute("observes", "devtoolsMenuBroadcaster_" + id);
-
   let menuitem = doc.createElement("menuitem");
   menuitem.id = "menuitem_" + id;
   menuitem.setAttribute("observes", "devtoolsMenuBroadcaster_" + id);
 
   if (toolDefinition.accesskey) {
     menuitem.setAttribute("accesskey", toolDefinition.accesskey);
   }
 
   return {
     cmd: cmd,
     key: key,
     bc: bc,
-    appmenuitem: appmenuitem,
     menuitem: menuitem
   };
 }
 
 /**
  * Create xul menuitem, command, broadcaster and key elements for a given tool.
  * And then insert them into browser DOM.
  *
@@ -122,34 +117,17 @@ function insertToolMenuElements(doc, too
   doc.getElementById("mainCommandSet").appendChild(elements.cmd);
 
   if (elements.key) {
     attachKeybindingsToBrowser(doc, elements.key);
   }
 
   doc.getElementById("mainBroadcasterSet").appendChild(elements.bc);
 
-  let amp = doc.getElementById("appmenu_webDeveloper_popup");
-  if (amp) {
-    let ref;
-
-    if (prevDef != null) {
-      let menuitem = doc.getElementById("appmenuitem_" + prevDef.id);
-      ref = menuitem && menuitem.nextSibling ? menuitem.nextSibling : null;
-    } else {
-      ref = doc.getElementById("appmenu_devtools_separator");
-    }
-
-    if (ref) {
-      amp.insertBefore(elements.appmenuitem, ref);
-    }
-  }
-
   let ref;
-
   if (prevDef) {
     let menuitem = doc.getElementById("menuitem_" + prevDef.id);
     ref = menuitem && menuitem.nextSibling ? menuitem.nextSibling : null;
   } else {
     ref = doc.getElementById("menu_devtools_separator");
   }
 
   if (ref) {
@@ -177,21 +155,16 @@ function removeToolFromMenu(toolId, doc)
     key.parentNode.removeChild(key);
   }
 
   let bc = doc.getElementById("devtoolsMenuBroadcaster_" + toolId);
   if (bc) {
     bc.parentNode.removeChild(bc);
   }
 
-  let appmenuitem = doc.getElementById("appmenuitem_" + toolId);
-  if (appmenuitem) {
-    appmenuitem.parentNode.removeChild(appmenuitem);
-  }
-
   let menuitem = doc.getElementById("menuitem_" + toolId);
   if (menuitem) {
     menuitem.parentNode.removeChild(menuitem);
   }
 }
 exports.removeToolFromMenu = removeToolFromMenu;
 
 /**
@@ -199,17 +172,16 @@ exports.removeToolFromMenu = removeToolF
  *
  * @param {XULDocument} doc
  *        The document to which the tool items are to be added.
  */
 function addAllToolsToMenu(doc) {
   let fragCommands = doc.createDocumentFragment();
   let fragKeys = doc.createDocumentFragment();
   let fragBroadcasters = doc.createDocumentFragment();
-  let fragAppMenuItems = doc.createDocumentFragment();
   let fragMenuItems = doc.createDocumentFragment();
 
   for (let toolDefinition of gDevTools.getToolDefinitionArray()) {
     if (!toolDefinition.inMenu) {
       continue;
     }
 
     let elements = createToolMenuElements(toolDefinition, doc);
@@ -218,33 +190,27 @@ function addAllToolsToMenu(doc) {
       continue;
     }
 
     fragCommands.appendChild(elements.cmd);
     if (elements.key) {
       fragKeys.appendChild(elements.key);
     }
     fragBroadcasters.appendChild(elements.bc);
-    fragAppMenuItems.appendChild(elements.appmenuitem);
     fragMenuItems.appendChild(elements.menuitem);
   }
 
   let mcs = doc.getElementById("mainCommandSet");
   mcs.appendChild(fragCommands);
 
   attachKeybindingsToBrowser(doc, fragKeys);
 
   let mbs = doc.getElementById("mainBroadcasterSet");
   mbs.appendChild(fragBroadcasters);
 
-  let amps = doc.getElementById("appmenu_devtools_separator");
-  if (amps) {
-    amps.parentNode.insertBefore(fragAppMenuItems, amps);
-  }
-
   let mps = doc.getElementById("menu_devtools_separator");
   if (mps) {
     mps.parentNode.insertBefore(fragMenuItems, mps);
   }
 }
 
 /**
  * Detect the presence of a Firebug.