NS_IMETHODIMP nsUnknownContentTypeHandler::PromptForSaveToFile( nsISupports * aWindowContext, const PRUnichar * aDefaultFile, const PRUnichar * aSuggestedFileExtension, nsILocalFile ** aNewFile ) {  return NS_OK; }
nsUnknownContentTypeHandler::PromptForSaveToFile(nsISupports * aWindowContext, const PRUnichar * aDefaultFile, const PRUnichar * aSuggestedFileExtension, nsILocalFile ** aNewFile) { nsresult rv = NS_OK; nsCOMPtr<nsIFilePicker> filePicker = do_CreateInstance("@mozilla.org/filepicker;1", &rv); if (filePicker) { nsCOMPtr<nsIStringBundleService> stringService = do_GetService(kStringBundleServiceCID); nsCOMPtr<nsIStringBundle> stringBundle; NS_ENSURE_TRUE(stringService, NS_ERROR_FAILURE);  NS_ENSURE_SUCCESS(stringService->CreateBundle(HELPERAPP_DIALOG_URL, nsnull, getter_AddRefs(stringBundle)), NS_ERROR_FAILURE);  nsXPIDLString windowTitle; stringBundle->GetStringFromName(NS_LITERAL_STRING("saveDialogTitle").get(), getter_Copies(windowTitle));  nsCOMPtr<nsIDOMWindowInternal> parent( do_GetInterface( aWindowContext ) ); filePicker->Init(parent, windowTitle, nsIFilePicker::modeSave); filePicker->SetDefaultString(aDefaultFile); nsAutoString wildCardExtension (NS_LITERAL_STRING("*").get()); if (aSuggestedFileExtension) { wildCardExtension.Append(aSuggestedFileExtension); filePicker->AppendFilter(wildCardExtension.GetUnicode(), wildCardExtension.GetUnicode()); }  filePicker->AppendFilters(nsIFilePicker::filterAll);  nsCOMPtr<nsILocalFile> startDir;  nsCOMPtr<nsIPref> prefs (do_GetService(NS_PREF_CONTRACTID)); if ( prefs ) { rv = prefs->GetFileXPref( "browser.download.dir", getter_AddRefs( startDir ) ); if ( NS_SUCCEEDED(rv) && startDir ) { PRBool isValid = PR_FALSE; startDir->Exists( &isValid ); if ( isValid ) filePicker->SetDisplayDirectory( startDir ); } }   PRInt16 dialogResult; filePicker->Show(&dialogResult); if (dialogResult == nsIFilePicker::returnCancel) rv = NS_ERROR_FAILURE; else {  rv = filePicker->GetFile(aNewFile); if (*aNewFile) { nsCOMPtr<nsIFile> newDirectory; (*aNewFile)->GetParent(getter_AddRefs(newDirectory)); nsCOMPtr<nsILocalFile> newLocalDirectory (do_QueryInterface(newDirectory));  if (newLocalDirectory) prefs->SetFileXPref( "browser.download.dir", newLocalDirectory); }  } }  return rv; }
NS_IMETHODIMP nsUnknownContentTypeHandler::PromptForSaveToFile( nsISupports * aWindowContext, const PRUnichar * aDefaultFile, const PRUnichar * aSuggestedFileExtension, nsILocalFile ** aNewFile ) {/* ATENTIE */ //printf("PromptForSaveToFile!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n\n\n");	return NS_OK;	}