B2G/gecko/browser/components/downloads/content/downloads.js
/**
   * Loads the specified overlay and invokes the given callback when finished.
   *
   * @param aOverlay
   *        String containing the URI of the overlay to load in the current
   *        window.  If this overlay has already been loaded using this
   *        function, then the overlay is not loaded again.
   * @param aCallback
   *        Invoked when loading is completed.  If the overlay is already
   *        loaded, the function is called immediately.
   */
Loads the specified overlay and invokes the given callback when finished.
@param aOverlay
String containing the URI of the overlay to load in the current
window.  If this overlay has already been loaded using this
function, then the overlay is not loaded again.
@param aCallback
Invoked when loading is completed.  If the overlay is already
loaded, the function is called immediately.
Loads the specified overlay and invokes the given callback when finished . @param aOverlay String containing the URI of the overlay to load in the current window . If this overlay has already been loaded using this function then the overlay is not loaded again . @param aCallback Invoked when loading is completed . If the overlay is already loaded the function is called immediately .
function DOL_ensureOverlayLoaded(aOverlay, aCallback)
  {
    if (aOverlay in this._loadedOverlays) {
      aCallback();
      return;
    }
    this._loadRequests.push({ overlay: aOverlay, callback: aCallback });
    if (this._overlayLoading) {
      return;
    }
    function DOL_EOL_loadCallback() {
      this._overlayLoading = false;
      this._loadedOverlays[aOverlay] = true;
      retrieveToolbarIconsizesFromTheme();
      this.processPendingRequests();
    }
    this._overlayLoading = true;
    document.loadOverlay(aOverlay, DOL_EOL_loadCallback.bind(this));
  }
function DOL_ensureOverlayLoaded ( aOverlay , aCallback ) { if ( aOverlay in this . _loadedOverlays ) { aCallback ( ) ; return ; } this . _loadRequests . push ( { overlay : aOverlay , callback : aCallback } ) ; if ( this . _overlayLoading ) { return ; } function DOL_EOL_loadCallback ( ) { this . _overlayLoading = false ; this . _loadedOverlays [ aOverlay ] = true ; retrieveToolbarIconsizesFromTheme ( ) ; this . processPendingRequests ( ) ; } this . _overlayLoading = true ; document . loadOverlay ( aOverlay , DOL_EOL_loadCallback . bind ( this ) ) ; }
Loads the specified overlay and invokes the given callback when finished.
Loads the specified overlay and invokes the given callback when finished .
// The overlay is already loaded, invoke the callback immediately. // The callback will be invoked when loading is finished. // Loading the overlay causes all the persisted XUL attributes to be // reapplied, including "iconsize" on the toolbars.  Until bug 640158 is // fixed, we must recalculate the correct "iconsize" attributes manually.