}
nsFileDownloadDialog::OnSave() {    // Prompt user for file name.    nsCOMPtr<nsIFileWidget> fileWidget;      nsString title("Save File");    nsComponentManager::CreateInstance( kCFileWidgetCID,                                        nsnull,                                        kIFileWidgetIID,                                        (void**)getter_AddRefs(fileWidget) );        nsFileSpec fileSpec;    nsFileDlgResults result = fileWidget->PutFile( nsnull, title, fileSpec );    if ( result == nsFileDlgResults_OK || result == nsFileDlgResults_Replace ) {        // Save the stream into the specified file...        mFileName = fileSpec;        mMode = kProgress;        nsString progressXUL = "resource:/res/samples/downloadProgress.xul";        mWebShell->LoadURL( progressXUL.GetUnicode() );        // Open output file stream.        mOutput = new nsOutputFileStream( mFileName );    }}