rem: openDialog("chrome: "chrome,titlebar,minimizable,dialog=yes", makeWebBrowserPersist(), persistArgs); 
add:   var dialog  = makeProgressDialog(); var persist = makeWebBrowserPersist();  dialog.source = makeURL(aData.url); dialog.target = persistArgs.target;   persist.progressListener = dialog;   const nsIWBP = Components.interfaces.nsIWebBrowserPersist; const flags = nsIWBP.PERSIST_FLAGS_NO_CONVERSION | nsIWBP.PERSIST_FLAGS_REPLACE_EXISTING_FILES; if (aData.bypassCache) persist.persistFlags = flags | nsIWBP.PERSIST_FLAGS_BYPASS_CACHE; else persist.persistFlags = flags | nsIWBP.PERSIST_FLAGS_FROM_CACHE;  if (isDocument && fp.filterIndex != 1) {  var filesFolder = null; if (persistArgs.contentType != "text/plain") {  const lfContractID = "@mozilla.org/file/local;1"; const lfIID = Components.interfaces.nsILocalFile; filesFolder = Components .classes[lfContractID].createInstance(lfIID); filesFolder.initWithUnicodePath(persistArgs.target.unicodePath);  var nameWithoutExtension = filesFolder.leafName; nameWithoutExtension = nameWithoutExtension.substring(0, nameWithoutExtension.lastIndexOf(".")); var filesFolderLeafName = getStringBundle().formatStringFromName("filesFolder", [nameWithoutExtension], 1);  filesFolder.leafName = filesFolderLeafName; }  var encodingFlags = 0; if (persistArgs.contentType == "text/plain") { encodingFlags |= nsIWBP.ENCODE_FLAGS_FORMATTED; encodingFlags |= nsIWBP.ENCODE_FLAGS_ABSOLUTE_LINKS; encodingFlags |= nsIWBP.ENCODE_FLAGS_NOFRAMES_CONTENT; }  const kWrapColumn = 80;  dialog.open(null, persist); persist.saveDocument(persistArgs.source, persistArgs.target, filesFolder, persistArgs.contentType, encodingFlags, kWrapColumn); } else { dialog.open(null, persist); persist.saveURI(source, persistArgs.postData, persistArgs.target); } 
context: function foundHeaderInfo(aSniffer, aData){  var contentType = aSniffer.contentType;  var fp = makeFilePicker();  var titleKey = aData.filePickerTitle || "SaveLinkTitle";  var bundle = getStringBundle();  fp.init(window, bundle.GetStringFromName(titleKey),           Components.interfaces.nsIFilePicker.modeSave);  var isDocument = aData.document != null && isDocumentType(contentType);  appendFiltersForContentType(fp, aSniffer.contentType,                              isDocument ? MODE_COMPLETE : MODE_FILEONLY);    const prefSvcContractID = "@mozilla.org/preferences-service;1";  const prefSvcIID = Components.interfaces.nsIPrefService;                                var prefs = Components.classes[prefSvcContractID].getService(prefSvcIID).getBranch("browser.download.");    const nsILocalFile = Components.interfaces.nsILocalFile;  try {    fp.displayDirectory = prefs.getComplexValue("dir", nsILocalFile);  }  catch (e) {  }  if (isDocument) {    try {      fp.filterIndex = prefs.getIntPref("save_converter_index");    }    catch (e) {    }  }    // Determine what the 'default' string to display in the File Picker dialog   // should be.   var defaultFileName = getDefaultFileName(aData.fileName,                                            aSniffer.suggestedFileName,                                            aSniffer.uri);  var defaultExtension = getDefaultExtension(defaultFileName, aSniffer.uri, contentType);  fp.defaultExtension = defaultExtension;  fp.defaultString = getNormalizedLeafName(defaultFileName, defaultExtension);    if (fp.show() == Components.interfaces.nsIFilePicker.returnCancel || !fp.file)    return;      if (isDocument)     prefs.setIntPref("save_converter_index", fp.filterIndex);  var directory = fp.file.parent.QueryInterface(nsILocalFile);  prefs.setComplexValue("dir", nsILocalFile, directory);      fp.file.leafName = validateFileName(fp.file.leafName);    // If we're saving a document, and are saving either in complete mode or   // as converted text, pass the document to the web browser persist component.  // If we're just saving the HTML (second option in the list), send only the URI.  var source = (isDocument && fp.filterIndex != 1) ? aData.document : aSniffer.uri;    var persistArgs = {    source      : source,    contentType : (isDocument && fp.filterIndex == 2) ? "text/plain" : contentType,    target      : fp.file,    postData    : isDocument ? getPostData() : null,    bypassCache : aData.bypassCache  };    openDialog("chrome://global/content/nsProgressDlg.xul", "",               "chrome,titlebar,minimizable,dialog=yes",               makeWebBrowserPersist(), persistArgs);}
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/ef2fa1788ffc548c2f2fe453605a73c324af29b0/contentAreaUtils.js/clean/suite/common/contentAreaUtils.js