NS_IMETHODIMP nsWindowMediator::GetMostRecentWindow( const PRUnichar* inType, nsIDOMWindow** outWindow )
nsWindowMediator::GetMostRecentWindow( const PRUnichar* inType, nsIDOMWindowInternal** outWindow)
NS_IMETHODIMP nsWindowMediator::GetMostRecentWindow( const PRUnichar* inType, nsIDOMWindow** outWindow ){	*outWindow = NULL;	PRInt32 lastTimeStamp = -1;	PRInt32 count = mWindowList.Count();	nsIWebShellWindow* mostRecentWindow;	nsString typeString( inType );	// Find the most window with the highest time stamp that matches the requested type	for ( int32 i = 0; i< count; i++ )	{			nsWindowInfo* windowInfo = (nsWindowInfo*) mWindowList[i];		if ( ( inType == NULL || windowInfo->GetType() == typeString ) && windowInfo->mTimeStamp >= lastTimeStamp )		{			mostRecentWindow = windowInfo->mWindow;			lastTimeStamp = windowInfo->mTimeStamp;		}	}		if( mostRecentWindow )	{			nsCOMPtr <nsIDOMWindow> DOMWindow;			if( NS_SUCCEEDED ( GetDOMWindow( mostRecentWindow, DOMWindow  ) ) )			{					*outWindow = DOMWindow;				return NS_OK;			}			else			{				return NS_ERROR_FAILURE;			}	}	else	{		return NS_ERROR_FAILURE;	}}