Quit();
PRBool serverMode = PR_FALSE; if (mNativeAppSupport) mNativeAppSupport->GetIsServerMode(&serverMode); if (!mQuitOnLastWindowClosing || serverMode) return NS_OK;  Quit();
nsAppShellService::UnregisterTopLevelWindow(nsIWebShellWindow* aWindow){  	if (mDeleteCalled) {		// return an error code in order to:		// - avoid doing anything with other member variables while we are in the destructor		// - notify the caller not to release the AppShellService after unregistering the window		//   (we don't want to be deleted twice consecutively to mHiddenWindow->Close() in our destructor)		return NS_ERROR_FAILURE;	}    nsIWindowMediator* service;  if (NS_SUCCEEDED(nsServiceManager::GetService(kWindowMediatorCID, kIWindowMediatorIID, (nsISupports**) &service ) ) )  {	service->UnregisterWindow( aWindow );	nsServiceManager::ReleaseService(kWindowMediatorCID, service);  }	  nsresult rv;  nsIWebShellContainer* wsc;  rv = aWindow->QueryInterface(kIWebShellContainerIID, (void **) &wsc);  if (NS_SUCCEEDED(rv)) {    mWindowList->RemoveElement(wsc);    NS_RELEASE(wsc);  }  PRUint32 cnt;  rv = mWindowList->Count(&cnt);  if (NS_FAILED(rv)) return rv;  if (0 == cnt)  {  #if XP_MAC  	if (mHiddenWindow)  	{	  	// Given hidden window the focus so it puts up the menu	 	nsIWidget* widget = NULL;	 	mHiddenWindow->GetWidget( widget );	 	if( widget )	 	{	 		widget->SetFocus();	 		  		widget->Release();	  	}	}	else	{		// if no hidden window is available (perhaps due to initial		// Profile Manager window being cancelled), then just quit		Quit();	}  #else  	  Quit();  #endif   }  return rv;}