From a12e912b25acf9b33ce755dcf6f122491ad7b6f3 Mon Sep 17 00:00:00 2001 From: "reed@reedloden.com" Date: Tue, 1 Apr 2008 01:30:31 -0700 Subject: [PATCH] Bug 425924 - "CVS remove mozilla/toolkit/components/downloads/src/old.cpp" [p=ryanvm@gmail.com (Ryan VanderMeulen) r=sdwilsh] --- toolkit/components/downloads/src/old.cpp | 74 ------------------------ 1 file changed, 74 deletions(-) delete mode 100644 toolkit/components/downloads/src/old.cpp diff --git a/toolkit/components/downloads/src/old.cpp b/toolkit/components/downloads/src/old.cpp deleted file mode 100644 index 2baba3a3e73..00000000000 --- a/toolkit/components/downloads/src/old.cpp +++ /dev/null @@ -1,74 +0,0 @@ - /** - * Opens an individual progress dialog displaying progress for the download. - * - * @param aPersistentDescriptor The persistent descriptor of the download to - * display progress for. - * - * @param aParent The parent, or opener, of the front end (optional). - */ - - void openProgressDialogFor(in wstring aPersistentDescriptor, in nsIDOMWindow aParent); - -NS_IMETHODIMP -nsDownloadManager::OpenProgressDialogFor(const PRUnichar* aPath, nsIDOMWindow* aParent) -{ - nsresult rv; - nsStringKey key(aPath); - if (!mCurrDownloads.Exists(&key)) - return NS_ERROR_FAILURE; - - nsCOMPtr download; - nsDownload* internalDownload = static_cast(mCurrDownloads.Get(&key)); - internalDownload->QueryInterface(NS_GET_IID(nsIDownload), (void**) getter_AddRefs(download)); - if (!download) - return NS_ERROR_FAILURE; - - - nsCOMPtr oldDialog; - internalDownload->GetDialog(getter_AddRefs(oldDialog)); - - if (oldDialog) { - nsCOMPtr window; - oldDialog->GetDialog(getter_AddRefs(window)); - if (window) { - nsCOMPtr internalWin = do_QueryInterface(window); - internalWin->Focus(); - return NS_OK; - } - } - - nsCOMPtr dialog(do_CreateInstance("@mozilla.org/progressdialog;1", &rv)); - if (NS_FAILED(rv)) return rv; - - nsCOMPtr dl = do_QueryInterface(dialog); - - // now give the dialog the necessary context - - // start time... - PRInt64 startTime = 0; - download->GetStartTime(&startTime); - - // source... - nsCOMPtr source; - download->GetSource(getter_AddRefs(source)); - - // target... - nsCOMPtr target; - download->GetTarget(getter_AddRefs(target)); - - // helper app... - nsCOMPtr mimeInfo; - download->GetMIMEInfo(getter_AddRefs(mimeInfo)); - - dl->Init(source, target, nsnull, mimeInfo, startTime, nsnull); - dl->SetObserver(this); - - // now set the listener so we forward notifications to the dialog - nsCOMPtr listener = do_QueryInterface(dialog); - internalDownload->SetDialogListener(listener); - - internalDownload->SetDialog(dialog); - - return dialog->Open(aParent); -} -