if ( mCachedWin ) { nsCOMPtr<nsIDOMWindowInternal> win = mCachedWin;  mCachedWin = 0;  ReParent( win, 0 ); } else {  rv = OpenWindow( "chrome: } return rv;
nsCOMPtr<nsIWindowMediator>    med( do_GetService( kWindowMediatorCID ) ); nsCOMPtr<nsIDOMWindowInternal> navWin; nsCOMPtr<nsIDOMWindow>         content; nsCOMPtr<nsIDOMWindowInternal> internalContent; nsCOMPtr<nsIDOMLocation>       location;   do { if ( !med ) { break; }  med->GetMostRecentWindow( NS_LITERAL_STRING( "navigator:browser" ).get(), getter_AddRefs( navWin ) ); if ( !navWin ) {  break; } else {  if ( mCachedWin == navWin ) {  mCachedWin = 0;  ReParent( navWin, 0 ); } }  navWin->GetContent( getter_AddRefs( content ) ); if ( !content ) { break; }  internalContent = do_QueryInterface( content ); if ( !internalContent ) { break; }  internalContent->GetLocation( getter_AddRefs( location ) ); if ( !location ) { break; }  SafeJSContext context; if ( NS_FAILED( context.Push() ) ) { break; }  nsAutoString url; url.AssignWithConversion( args ); if ( NS_FAILED( location->SetHref( url ) ) ) { break; }  return NS_OK; } while ( PR_FALSE );   return OpenWindow( "chrome:
nsNativeAppSupportWin::OpenBrowserWindow( const char *args ) {    nsresult rv = NS_OK;    // Check if we have a cached (hidden) window.    if ( mCachedWin ) {        nsCOMPtr<nsIDOMWindowInternal> win = mCachedWin;        // Drop window from cache.        mCachedWin = 0;        // Show it.        ReParent( win, 0 );    } else {        // No cached window, open a new one.        rv = OpenWindow( "chrome://navigator/content", args );    }    return rv;}