B2G/gecko/toolkit/components/exthelper/extApplication.js
// helper method for correct quitting/restarting
helper method for correct quitting/restarting
helper method for correct quitting / restarting
function app__quitWithFlags(aFlags) {
    let cancelQuit = Components.classes["@mozilla.org/supports-PRBool;1"]
                               .createInstance(Components.interfaces.nsISupportsPRBool);
    let quitType = aFlags & Components.interfaces.nsIAppStartup.eRestart ? "restart" : null;
    this._obs.notifyObservers(cancelQuit, "quit-application-requested", quitType);
    if (cancelQuit.data)
      return false; 
    let appStartup = Components.classes['@mozilla.org/toolkit/app-startup;1']
                               .getService(Components.interfaces.nsIAppStartup);
    appStartup.quit(aFlags);
    return true;
  }
function app__quitWithFlags ( aFlags ) { let cancelQuit = Components . classes [ "@mozilla.org/supports-PRBool;1" ] . createInstance ( Components . interfaces . nsISupportsPRBool ) ; let quitType = aFlags & Components . interfaces . nsIAppStartup . eRestart ? "restart" : null ; this . _obs . notifyObservers ( cancelQuit , "quit-application-requested" , quitType ) ; if ( cancelQuit . data ) return false ; let appStartup = Components . classes [ '@mozilla.org/toolkit/app-startup;1' ] . getService ( Components . interfaces . nsIAppStartup ) ; appStartup . quit ( aFlags ) ; return true ; }
helper method for correct quitting/restarting
helper method for correct quitting / restarting
// somebody canceled our quit request