rv = CreateTopLevelWindow(aParent, aUrl, PR_TRUE, aChromeMask,
rv = CreateTopLevelWindow(aParent, aUrl, PR_TRUE, PR_TRUE, aChromeMask,
nsAppShellService::RunModalDialog(                      nsIWebShellWindow **aWindow,                      nsIWebShellWindow *aParent,                      nsIURI *aUrl,                       PRUint32 aChromeMask,                      nsIXULWindowCallbacks *aCallbacks,                      PRInt32 aInitialWidth, PRInt32 aInitialHeight){  nsresult          rv;  nsIWebShellWindow *theWindow;  PRBool            pushedQueue;  pushedQueue = PR_FALSE;  if (aWindow && *aWindow) {    theWindow = *aWindow; // and rv is already some success indication    NS_ADDREF(theWindow);    rv = NS_OK;  } else {    pushedQueue = PR_TRUE;    PushThreadEventQueue();    rv = CreateTopLevelWindow(aParent, aUrl, PR_TRUE, aChromeMask,            aCallbacks, aInitialWidth, aInitialHeight, &theWindow);  }  if (NS_SUCCEEDED(rv)) {    nsCOMPtr<nsIWidget> parentWindowWidgetThing;    nsresult gotParent;    gotParent = aParent ? aParent->GetWidget(*getter_AddRefs(parentWindowWidgetThing)) :                          NS_ERROR_FAILURE;    // Windows OS wants the parent disabled for modality    if (NS_SUCCEEDED(gotParent))      parentWindowWidgetThing->Enable(PR_FALSE);    theWindow->ShowModal();    if (NS_SUCCEEDED(gotParent))      parentWindowWidgetThing->Enable(PR_TRUE);    // return the used window if possible, or otherwise get rid of it    if (aWindow)      if (*aWindow)        NS_RELEASE(theWindow); // we borrowed it, now let it go      else        *aWindow = theWindow;  // and it's addrefed from Create...    else      NS_RELEASE(theWindow);   // can't return it; let it go  }  if (pushedQueue)    PopThreadEventQueue();  return rv;}