зеркало из https://github.com/mozilla/gecko-dev.git
131762 - can open multiple occurrences of download manager. r=hixie sr=ben
This commit is contained in:
Родитель
9e320eac43
Коммит
d1d69edf30
|
@ -39,6 +39,7 @@ REQUIRES = xpcom \
|
|||
intl \
|
||||
windowwatcher \
|
||||
webbrowserpersist \
|
||||
appshell \
|
||||
dom \
|
||||
$(NULL)
|
||||
CPPSRCS = \
|
||||
|
|
|
@ -30,6 +30,7 @@ REQUIRES = xpcom \
|
|||
intl \
|
||||
windowwatcher \
|
||||
webbrowserpersist \
|
||||
appshell \
|
||||
dom \
|
||||
$(NULL)
|
||||
|
||||
|
|
|
@ -54,6 +54,7 @@
|
|||
#include "nsIWebBrowserPersist.h"
|
||||
#include "nsIWindowWatcher.h"
|
||||
#include "nsIStringBundle.h"
|
||||
#include "nsIWindowMediator.h"
|
||||
|
||||
/* Outstanding issues/todo:
|
||||
* 1. Implement pause/resume.
|
||||
|
@ -638,9 +639,18 @@ nsDownloadManager::Open(nsIDOMWindow* aParent)
|
|||
// if this fails, it fails -- continue.
|
||||
AssertProgressInfo();
|
||||
|
||||
//check for an existing manager window and focus it
|
||||
nsresult rv;
|
||||
nsCOMPtr<nsIWindowMediator> wm = do_GetService("@mozilla.org/rdf/datasource;1?name=window-mediator", &rv);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
nsCOMPtr<nsIDOMWindowInternal> recentWindow;
|
||||
wm->GetMostRecentWindow(NS_LITERAL_STRING("Download:Manager").get(), getter_AddRefs(recentWindow));
|
||||
if (recentWindow)
|
||||
return recentWindow->Focus();
|
||||
|
||||
// if we ever have the capability to display the UI of third party dl managers,
|
||||
// we'll open their UI here instead.
|
||||
nsresult rv;
|
||||
nsCOMPtr<nsIWindowWatcher> ww = do_GetService("@mozilla.org/embedcomp/window-watcher;1", &rv);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче