B2G/gecko/browser/components/downloads/content/downloads.js
/**
   * Called when the download state might have changed.  Sometimes the state of
   * the download might be the same as before, if the data layer received
   * multiple events for the same download.
   */
Called when the download state might have changed.  Sometimes the state of
the download might be the same as before, if the data layer received
multiple events for the same download.
Called when the download state might have changed . Sometimes the state of the download might be the same as before if the data layer received multiple events for the same download .
function DVI_onStateChange()
  {
    if (!this.wasDone && this.dataItem.openable) {
      this._element.setAttribute("image", this.image + "&state=normal");
    }
    if (this.wasInProgress && !this.dataItem.inProgress) {
      this.endTime = Date.now();
    }
    this.wasDone = this.dataItem.done;
    this.wasInProgress = this.dataItem.inProgress;
    this._element.setAttribute("state", this.dataItem.state);
    this._updateProgress();
    this._updateStatusLine();
  }
function DVI_onStateChange ( ) { if ( ! this . wasDone && this . dataItem . openable ) { this . _element . setAttribute ( "image" , this . image + "&state=normal" ) ; } if ( this . wasInProgress && ! this . dataItem . inProgress ) { this . endTime = Date . now ( ) ; } this . wasDone = this . dataItem . done ; this . wasInProgress = this . dataItem . inProgress ; this . _element . setAttribute ( "state" , this . dataItem . state ) ; this . _updateProgress ( ) ; this . _updateStatusLine ( ) ; }
Called when the download state might have changed.
Called when the download state might have changed .
// If a download just finished successfully, it means that the target file // now exists and we can extract its specific icon.  To ensure that the icon // is reloaded, we must change the URI used by the XUL image element, for // example by adding a query parameter.  Since this URI has a "moz-icon" // scheme, this only works if we add one of the parameters explicitly // supported by the nsIMozIconURI interface. // Update the end time using the current time if required. // Update the user interface after switching states.