aStartTime, aCancelable, getter_AddRefs(mInner));
aStartTime, aCancelable, aTempFile, getter_AddRefs(mInner));
  NS_IMETHODIMP Init(nsIURI* aSource,                     nsIURI* aTarget,                     const nsAString& aDisplayName,                     nsIMIMEInfo *aMIMEInfo,                     PRTime aStartTime,                     nsICancelable* aCancelable) {    nsresult rv;    nsCOMPtr<nsIDownloadManager> dm = do_GetService("@mozilla.org/download-manager;1", &rv);    if (NS_FAILED(rv))      return rv;        rv = dm->AddDownload(nsIDownloadManager::DOWNLOAD_TYPE_DOWNLOAD, aSource,                         aTarget, aDisplayName, EmptyString(), aMIMEInfo,                         aStartTime, aCancelable, getter_AddRefs(mInner));    if (NS_FAILED(rv)) return rv;    nsCOMPtr<nsIPrefService> prefs = do_GetService("@mozilla.org/preferences-service;1", &rv);    if (NS_FAILED(rv)) return rv;    nsCOMPtr<nsIPrefBranch> branch = do_QueryInterface(prefs);    PRBool showDM = PR_TRUE;    branch->GetBoolPref(PREF_BDM_SHOWWHENSTARTING , &showDM);    PRBool useWindow = PR_TRUE;    branch->GetBoolPref(PREF_BDM_USEWINDOW, &useWindow);    if (showDM && useWindow) {      nsAutoString path;      nsCOMPtr<nsIFileURL> fileURL = do_QueryInterface(aTarget, &rv);      if (NS_FAILED(rv)) return rv;      nsCOMPtr<nsIFile> file;      rv = fileURL->GetFile(getter_AddRefs(file));      if (NS_FAILED(rv)) return rv;      rv = file->GetPath(path);      if (NS_FAILED(rv)) return rv;      return dm->Open(nsnull, path.get());    }    return rv;  }