From 529b22c8b39ffdeb01d491cf4d0b8712aa3d824a Mon Sep 17 00:00:00 2001 From: "dougt%netscape.com" Date: Thu, 6 May 1999 03:59:47 +0000 Subject: [PATCH] Hooking up xpinstall to the viewer. This will cause a new instance of the xpinstall to be created when the viewer launches. This will be removed (along with the startup of silentdl) once we have a way of starting up components less intrusive. nsViewer.cpp - Added CreateInstance and related code to start component makefile.win - Added new include path --- webshell/tests/viewer/makefile.win | 1 + webshell/tests/viewer/nsViewerApp.cpp | 43 +++++++++++++++++---------- 2 files changed, 29 insertions(+), 15 deletions(-) diff --git a/webshell/tests/viewer/makefile.win b/webshell/tests/viewer/makefile.win index 13ed8292214a..cca4920df084 100644 --- a/webshell/tests/viewer/makefile.win +++ b/webshell/tests/viewer/makefile.win @@ -69,6 +69,7 @@ LINCS= \ -I$(PUBLIC)\intl \ -I$(PUBLIC)\rdf \ -I$(PUBLIC)\silentdl \ + -I$(PUBLIC)\xpinstall \ -I$(PUBLIC)\wallet \ -I$(PUBLIC)\profile \ !if defined(NGPREFS) diff --git a/webshell/tests/viewer/nsViewerApp.cpp b/webshell/tests/viewer/nsViewerApp.cpp index 060faa1927fc..0595c626317d 100644 --- a/webshell/tests/viewer/nsViewerApp.cpp +++ b/webshell/tests/viewer/nsViewerApp.cpp @@ -82,6 +82,18 @@ static NS_DEFINE_IID(kISilentDownloadIID, NS_IDOMSILENTDOWNLOAD_IID); static NS_DEFINE_IID(kSilentDownloadCID, NS_SilentDownload_CID); /*********************************************/ +/********************************************* + SoftwareUpdate +*********************************************/ +#include "nsISoftwareUpdate.h" +#include "nsSoftwareUpdateIIDs.h" + +static nsISoftwareUpdate *softwareUpdate= NULL; +static NS_DEFINE_IID(kISoftwareUpdateIID, NS_ISOFTWAREUPDATE_IID); +static NS_DEFINE_IID(kSoftwareUpdateCID, NS_SoftwareUpdate_CID); +/*********************************************/ + + extern nsresult NS_NewBrowserWindowFactory(nsIFactory** aFactory); extern nsresult NS_NewXPBaseWindowFactory(nsIFactory** aFactory); extern "C" void NS_SetupRegistry(); @@ -284,17 +296,17 @@ nsViewerApp::Initialize(int argc, char** argv) return rv; } - // XXX silent download + + rv = nsComponentManager::CreateInstance(kSoftwareUpdateCID, + nsnull, + kISoftwareUpdateIID, + (void**) &softwareUpdate); + + rv = nsComponentManager::CreateInstance(kSilentDownloadCID, - nsnull, - kISilentDownloadIID, - (void**) &silentDownload); - if (rv == NS_OK) { - if (silentDownload->Startup() != NS_OK) { - silentDownload->Shutdown(); - NS_RELEASE(silentDownload); - } - } + nsnull, + kISilentDownloadIID, + (void**) &silentDownload); // Finally process our arguments rv = ProcessArguments(argc, argv); @@ -306,11 +318,12 @@ nsViewerApp::Initialize(int argc, char** argv) nsresult nsViewerApp::Exit() { - if (silentDownload != NULL) - { - silentDownload->Shutdown(); - NS_RELEASE(silentDownload); - } + if (silentDownload != nsnull) + NS_RELEASE(silentDownload); + + if (softwareUpdate!= nsnull) + NS_RELEASE(softwareUpdate); + Destroy(); mAppShell->Exit();