B2G/gecko/browser/devtools/webconsole/HUDService.jsm
/**
   * Deactivate a HeadsUpDisplay for the given tab context.
   *
   * @param nsIDOMElement aTab
   *        The xul:tab element you want to enable the Web Console for.
   * @param boolean aAnimated
   *        True if you want to animate the closing of the Web console.
   * @return void
   */
Deactivate a HeadsUpDisplay for the given tab context.
@param nsIDOMElement aTab
The xul:tab element you want to enable the Web Console for.
@param boolean aAnimated
True if you want to animate the closing of the Web console.
@return void
Deactivate a HeadsUpDisplay for the given tab context . @param nsIDOMElement aTab The xul : tab element you want to enable the Web Console for . @param boolean aAnimated True if you want to animate the closing of the Web console . @return void
function HS_deactivateHUDForContext(aTab, aAnimated)
  {
    let hudId = "hud_" + aTab.linkedPanel;
    if (!(hudId in this.hudReferences)) {
      return;
    }
    if (!aAnimated) {
      this.storeHeight(hudId);
    }
    let hud = this.getHudReferenceById(hudId);
    let document = hud.chromeDocument;
    hud.destroy(function() {
      let id = WebConsoleUtils.supportsString(hudId);
      Services.obs.notifyObservers(id, "web-console-destroyed", null);
    });
    delete this.hudReferences[hudId];
    if (Object.keys(this.hudReferences).length == 0) {
      let autocompletePopup = document.
                              getElementById("webConsole_autocompletePopup");
      if (autocompletePopup) {
        autocompletePopup.parentNode.removeChild(autocompletePopup);
      }
      let window = document.defaultView;
      window.removeEventListener("unload", this.onWindowUnload, false);
      let gBrowser = window.gBrowser;
      let tabContainer = gBrowser.tabContainer;
      tabContainer.removeEventListener("TabClose", this.onTabClose, false);
      tabContainer.removeEventListener("TabSelect", this.onTabSelect, false);
      this.suspend();
    }
    let contentWindow = aTab.linkedBrowser.contentWindow;
    contentWindow.focus();
    HeadsUpDisplayUICommands.refreshCommand();
  }
function HS_deactivateHUDForContext ( aTab , aAnimated ) { let hudId = "hud_" + aTab . linkedPanel ; if ( ! ( hudId in this . hudReferences ) ) { return ; } if ( ! aAnimated ) { this . storeHeight ( hudId ) ; } let hud = this . getHudReferenceById ( hudId ) ; let document = hud . chromeDocument ; hud . destroy ( function ( ) { let id = WebConsoleUtils . supportsString ( hudId ) ; Services . obs . notifyObservers ( id , "web-console-destroyed" , null ) ; } ) ; delete this . hudReferences [ hudId ] ; if ( Object . keys ( this . hudReferences ) . length == 0 ) { let autocompletePopup = document . getElementById ( "webConsole_autocompletePopup" ) ; if ( autocompletePopup ) { autocompletePopup . parentNode . removeChild ( autocompletePopup ) ; } let window = document . defaultView ; window . removeEventListener ( "unload" , this . onWindowUnload , false ) ; let gBrowser = window . gBrowser ; let tabContainer = gBrowser . tabContainer ; tabContainer . removeEventListener ( "TabClose" , this . onTabClose , false ) ; tabContainer . removeEventListener ( "TabSelect" , this . onTabSelect , false ) ; this . suspend ( ) ; } let contentWindow = aTab . linkedBrowser . contentWindow ; contentWindow . focus ( ) ; HeadsUpDisplayUICommands . refreshCommand ( ) ; }
Deactivate a HeadsUpDisplay for the given tab context.
Deactivate a HeadsUpDisplay for the given tab context .