help support the doc loader using the web progress listener.

This commit is contained in:
mscott%netscape.com 2000-04-22 23:17:11 +00:00
Родитель 91744b5cc1
Коммит e80ecd5bda
2 изменённых файлов: 16 добавлений и 15 удалений

Просмотреть файл

@ -106,10 +106,10 @@ interface nsIURILoader : nsISupports
/* these are nsURILoadCommand */
const long viewNormal = 0;
const long viewNormal = 0;
const long viewUserClick = 1;
const long viewNewWindow = 2;
const long viewNormalBackground = 3;
const long viewNewWindow = 2;
const long viewNormalBackground = 3;
/* mscott -> I'm going to move this out into a separate private interface
*/

Просмотреть файл

@ -607,6 +607,19 @@ NS_IMETHODIMP nsURILoader::OpenURIVia(nsIChannel * aChannel,
nsCOMPtr<nsISupports> loadCookie;
SetupLoadCookie(retargetedWindowContext, getter_AddRefs(loadCookie));
// every time we do a load, we should reset the progress listener on it...
if (loadCookie)
{
// bind the web progress listener (if there is one) to the web progress
// instance of the doc loader..
nsCOMPtr<nsIDocumentLoader> docLoader (do_GetInterface(loadCookie));
nsCOMPtr<nsIWebProgress> webProgress (do_QueryInterface(docLoader));
nsCOMPtr<nsIWebProgressListener> webProgressListener (do_GetInterface(retargetedWindowContext));
if (webProgress && webProgressListener)
webProgress->AddProgressListener(webProgressListener);
}
loader->Init(retargetedWindowContext, aOriginalWindowContext); // Extra Info
// now instruct the loader to go ahead and open the url
@ -684,18 +697,6 @@ nsresult nsURILoader::SetupLoadCookie(nsISupports * aWindowContext, nsISupports
} // if we don't have a load cookie already
} // if we have a cntListener
// every time we do a load, we should reset the progress listener on it...
if (loadCookie)
{
// bind the web progress listener (if there is one) to the web progress
// instance of the doc loader..
nsCOMPtr<nsIDocumentLoader> docLoader (do_GetInterface(loadCookie));
nsCOMPtr<nsIWebProgress> webProgress (do_QueryInterface(docLoader));
nsCOMPtr<nsIWebProgressListener> webProgressListener (do_GetInterface(aWindowContext));
if (webProgress && webProgressListener)
webProgress->AddProgressListener(webProgressListener);
}
*aLoadCookie = loadCookie;
NS_IF_ADDREF(*aLoadCookie);