B2G/gecko/browser/devtools/styleeditor/StyleEditorChrome.jsm
/**
   * Set the content window attached to this chrome.
   * Content attach or detach events/notifications are triggered after the
   * operation is complete (possibly asynchronous if the content is not fully
   * loaded yet).
   *
   * @param DOMWindow aContentWindow
   * @see addChromeListener
   */
Set the content window attached to this chrome.
Content attach or detach events/notifications are triggered after the
operation is complete (possibly asynchronous if the content is not fully
loaded yet).


Set the content window attached to this chrome . Content attach or detach events / notifications are triggered after the operation is complete ( possibly asynchronous if the content is not fully loaded yet ) .
set contentWindow(aContentWindow)
  {
    if (this._contentWindow == aContentWindow) {
      return; 
    }
    this._contentWindow = aContentWindow;
    if (!aContentWindow) {
      this._disableChrome();
      return;
    }
    let onContentUnload = function () {
      aContentWindow.removeEventListener("unload", onContentUnload, false);
      if (this.contentWindow == aContentWindow) {
        this.contentWindow = null; 
      }
    }.bind(this);
    aContentWindow.addEventListener("unload", onContentUnload, false);
    if (aContentWindow.document.readyState == "complete") {
      this._root.classList.remove("loading");
      this._populateChrome();
      return;
    } else {
      this._root.classList.add("loading");
      let onContentReady = function () {
        aContentWindow.removeEventListener("load", onContentReady, false);
        this._root.classList.remove("loading");
        this._populateChrome();
      }.bind(this);
      aContentWindow.addEventListener("load", onContentReady, false);
    }
  }
set contentWindow ( aContentWindow ) { if ( this . _contentWindow == aContentWindow ) { return ; } this . _contentWindow = aContentWindow ; if ( ! aContentWindow ) { this . _disableChrome ( ) ; return ; } let onContentUnload = function ( ) { aContentWindow . removeEventListener ( "unload" , onContentUnload , false ) ; if ( this . contentWindow == aContentWindow ) { this . contentWindow = null ; } } . bind ( this ) ; aContentWindow . addEventListener ( "unload" , onContentUnload , false ) ; if ( aContentWindow . document . readyState == "complete" ) { this . _root . classList . remove ( "loading" ) ; this . _populateChrome ( ) ; return ; } else { this . _root . classList . add ( "loading" ) ; let onContentReady = function ( ) { aContentWindow . removeEventListener ( "load" , onContentReady , false ) ; this . _root . classList . remove ( "loading" ) ; this . _populateChrome ( ) ; } . bind ( this ) ; aContentWindow . addEventListener ( "load" , onContentReady , false ) ; } }
Set the content window attached to this chrome.
Set the content window attached to this chrome .
// no change // detach