if(mWindowMediator) mWindowMediator->RegisterWindow(aWindow);  return NS_OK;
nsIWebShellContainer* wsc; rv = aWindow->QueryInterface(NS_GET_IID(nsIWebShellContainer), (void **) &wsc); if (NS_SUCCEEDED(rv)) { mWindowList->AppendElement(wsc); NS_RELEASE(wsc);  nsIWindowMediator* service; if (NS_SUCCEEDED(nsServiceManager::GetService(kWindowMediatorCID, NS_GET_IID(nsIWindowMediator), (nsISupports**) &service ) ) ) { service->RegisterWindow( aWindow); nsServiceManager::ReleaseService(kWindowMediatorCID, service); } } return rv;
nsAppShellService::RegisterTopLevelWindow(nsIXULWindow* aWindow){   mWindowList->AppendElement(aWindow);   if(mWindowMediator)      mWindowMediator->RegisterWindow(aWindow);   return NS_OK;}