rem: contentType: contentType, 
add: contentType: aContentType, 
context: function internalSave(aURL, aDocument, aDefaultFileName, aShouldBypassCache,                      aFilePickerTitleKey, aChosenData, aReferrer){  // Note: aDocument == null when this code is used by save-link-as...  var contentType = (aDocument ? aDocument.contentType : null);  var saveMode = GetSaveModeForContentType(contentType);  var isDocument = aDocument != null && saveMode != SAVEMODE_FILEONLY;  var saveAsType = SAVETYPE_COMPLETE_PAGE;  var file, fileURL;  // Find the URI object for aURL and the FileName/Extension to use when saving.  // FileName/Extension will be ignored if aChosenData supplied.  var fileInfo = new FileInfo(aDefaultFileName);  if (aChosenData)    file = aChosenData.file;  else {    initFileInfo(fileInfo, aURL, aDocument, contentType);    var fpParams = {      fpTitleKey: aFilePickerTitleKey,      isDocument: isDocument,      fileInfo: fileInfo,      contentType: contentType,      saveMode: saveMode,      saveAsType: saveAsType,      file: file,      fileURL: fileURL    };    if (!poseFilePicker(fpParams))      // If the method returned false this is because the user cancelled from      // the save file picker dialog.      return;    saveAsType = fpParams.saveAsType;    saveMode = fpParams.saveMode;    file = fpParams.file;    fileURL = fpParams.fileURL;  }  if (!fileURL)    fileURL = makeFileURI(file);  // XXX We depend on the following holding true in appendFiltersForContentType():  // If we should save as a complete page, the saveAsType is SAVETYPE_COMPLETE_PAGE.  // If we should save as text, the saveAsType is SAVETYPE_TEXT_ONLY.  var useSaveDocument = isDocument &&                        (((saveMode & SAVEMODE_COMPLETE_DOM) && (saveAsType == SAVETYPE_COMPLETE_PAGE)) ||                         ((saveMode & SAVEMODE_COMPLETE_TEXT) && (saveAsType == SAVETYPE_TEXT_ONLY)));  // 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 = useSaveDocument ? aDocument : fileInfo.uri;  var persistArgs = {    source      : source,    contentType : (!aChosenData && useSaveDocument && saveAsType == SAVETYPE_TEXT_ONLY) ? "text/plain" : contentType,    target      : fileURL,    postData    : isDocument ? getPostData() : null,    bypassCache : aShouldBypassCache  };  var persist = makeWebBrowserPersist();  // Calculate persist flags.  const nsIWBP = Components.interfaces.nsIWebBrowserPersist;  const flags = nsIWBP.PERSIST_FLAGS_REPLACE_EXISTING_FILES;  if (aShouldBypassCache)    persist.persistFlags = flags | nsIWBP.PERSIST_FLAGS_BYPASS_CACHE;  else    persist.persistFlags = flags | nsIWBP.PERSIST_FLAGS_FROM_CACHE;  // Leave it to WebBrowserPersist to discover the encoding type (or lack thereof):  persist.persistFlags |= nsIWBP.PERSIST_FLAGS_AUTODETECT_APPLY_CONVERSION;  // Create download and initiate it (below)  var tr = Components.classes["@mozilla.org/transfer;1"].createInstance(Components.interfaces.nsITransfer);  if (useSaveDocument) {    // Saving a Document, not a URI:    var filesFolder = null;    if (persistArgs.contentType != "text/plain") {      // Create the local directory into which to save associated files.      filesFolder = file.clone();      var nameWithoutExtension = filesFolder.leafName.replace(/\.[^.]*$/, "");      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;    }    else {      encodingFlags |= nsIWBP.ENCODE_FLAGS_ENCODE_BASIC_ENTITIES;    }    const kWrapColumn = 80;    tr.init((aChosenData ? aChosenData.uri : fileInfo.uri),            persistArgs.target, null, null, null, persist);    persist.saveDocument(persistArgs.source, persistArgs.target, filesFolder,                         persistArgs.contentType, encodingFlags, kWrapColumn);  } else {    tr.init((aChosenData ? aChosenData.uri : source),            persistArgs.target, null, null, null, persist);    var referer = aReferrer || getReferrer(document);    persist.saveURI((aChosenData ? aChosenData.uri : source),                    null, referer, persistArgs.postData, null, persistArgs.target);  }}
meta: 10234	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/10234/9d31f357b343f20a37d105095d61f896f65e58b7/contentAreaUtils.js/buggy/xpfe/communicator/resources/content/contentAreaUtils.js