bug 866304 DialogUI dialogs cleanup patch. Removes unused/obsolete code from DialogUI. r=mbrubeck
☠☠ backed out by 195dd104d35a ☠ ☠
authorTim Abraldes <tabraldes@mozilla.com>
Mon, 05 Aug 2013 23:29:55 -0700
changeset 141534 e0061be20d1e7266027f23f3bcda54f1977ae5ad
parent 141533 5160639171574a25357174a950c7691940c65052
child 141535 14434d2b75b9360a37247269a3a7f0f0230ad92c
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersmbrubeck
bugs866304
milestone26.0a1
bug 866304 DialogUI dialogs cleanup patch. Removes unused/obsolete code from DialogUI. r=mbrubeck The "dialog" concept is unused (the last consumer was the sync setup UI which is now a flyout) and is obsolete since we have prompts.
browser/metro/base/content/browser-ui.js
--- a/browser/metro/base/content/browser-ui.js
+++ b/browser/metro/base/content/browser-ui.js
@@ -226,17 +226,16 @@ var BrowserUI = {
    * Content visibility
    */
 
   get isContentShowing() {
     return Elements.contentShowing.getAttribute("disabled") != true;
   },
 
   showContent: function showContent(aURI) {
-    DialogUI.closeAllDialogs();
     StartUI.update(aURI);
     ContextUI.dismissTabs();
     ContextUI.dismissContextAppbar();
     FlyoutPanelsUI.hide();
     PanelUI.hide();
   },
 
   /*********************************
@@ -730,23 +729,16 @@ var BrowserUI = {
     }
 
     // Check open popups
     if (DialogUI._popup) {
       DialogUI._hidePopup();
       return;
     }
 
-    // Check open dialogs
-    let dialog = DialogUI.activeDialog;
-    if (dialog) {
-      dialog.close();
-      return;
-    }
-
     // Check open modal elements
     if (DialogUI.modals.length > 0) {
       return;
     }
 
     // Check open panel
     if (PanelUI.isVisible) {
       PanelUI.hide();
@@ -1311,17 +1303,16 @@ var PanelUI = {
   _fire: function _fire(aName, anElement) {
     let event = document.createEvent("Events");
     event.initEvent(aName, true, true);
     anElement.dispatchEvent(event);
   }
 };
 
 var DialogUI = {
-  _dialogs: [],
   _popup: null,
 
   init: function() {
     window.addEventListener("mousedown", this, true);
   },
 
   /*******************************************
    * Modal popups
@@ -1379,49 +1370,16 @@ var DialogUI = {
     parentNode.insertBefore(back, contentMenuContainer);
 
     dialog.arguments = aArguments;
     dialog.parent = aParent;
     return dialog;
   },
 
   /*******************************************
-   * Dialogs
-   */
-
-  get activeDialog() {
-    // Return the topmost dialog
-    if (this._dialogs.length)
-      return this._dialogs[this._dialogs.length - 1];
-    return null;
-  },
-
-  closeAllDialogs: function closeAllDialogs() {
-    while (this.activeDialog)
-      this.activeDialog.close();
-  },
-
-  pushDialog: function pushDialog(aDialog) {
-    // If we have a dialog push it on the stack and set the attr for CSS
-    if (aDialog) {
-      this._dialogs.push(aDialog);
-      Elements.contentShowing.setAttribute("disabled", "true");
-    }
-  },
-
-  popDialog: function popDialog() {
-    if (this._dialogs.length)
-      this._dialogs.pop();
-
-    // If no more dialogs are being displayed, remove the attr for CSS
-    if (!this._dialogs.length)
-      Elements.contentShowing.removeAttribute("disabled");
-  },
-
-  /*******************************************
    * Popups
    */
 
   pushPopup: function pushPopup(aPanel, aElements, aParent) {
     this._hidePopup();
     this._popup =  { "panel": aPanel,
                      "elements": (aElements instanceof Array) ? aElements : [aElements] };
     this._dispatchPopupChanged(true, aPanel);