From 41cd02ba7e1deca47fcc8cfc8d3265a7ddb12a9c Mon Sep 17 00:00:00 2001 From: "dougt%netscape.com" Date: Thu, 3 Jun 1999 22:57:43 +0000 Subject: [PATCH] Changing ProgressNotifier to be nsISupports. Adding a GUI progress dialog! git-svn-id: svn://10.0.0.236/trunk@33646 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/xpinstall/public/MANIFEST | 1 - mozilla/xpinstall/public/Makefile.in | 3 +- mozilla/xpinstall/public/makefile.win | 10 ++- mozilla/xpinstall/public/nsISoftwareUpdate.h | 6 +- mozilla/xpinstall/src/makefile.win | 2 + mozilla/xpinstall/src/nsInstall.cpp | 4 +- mozilla/xpinstall/src/nsInstall.h | 4 +- mozilla/xpinstall/src/nsInstallTrigger.cpp | 6 +- .../src/nsLoggingProgressNotifier.cpp | 39 +++++++----- .../xpinstall/src/nsLoggingProgressNotifier.h | 20 +++--- mozilla/xpinstall/src/nsSoftwareUpdate.cpp | 62 +++++++++++++++++-- mozilla/xpinstall/src/nsSoftwareUpdate.h | 6 +- mozilla/xpinstall/src/nsSoftwareUpdateRun.cpp | 2 +- .../xpinstall/src/nsTopProgressNotifier.cpp | 44 ++++++++----- mozilla/xpinstall/src/nsTopProgressNotifier.h | 21 ++++--- 15 files changed, 155 insertions(+), 75 deletions(-) diff --git a/mozilla/xpinstall/public/MANIFEST b/mozilla/xpinstall/public/MANIFEST index 064fd015e73..10b2b3b652f 100644 --- a/mozilla/xpinstall/public/MANIFEST +++ b/mozilla/xpinstall/public/MANIFEST @@ -4,4 +4,3 @@ nsISoftwareUpdate.h nsSoftwareUpdateIIDs.h -nsIXPInstallProgressNotifier.h \ No newline at end of file diff --git a/mozilla/xpinstall/public/Makefile.in b/mozilla/xpinstall/public/Makefile.in index 6c4be8050e8..7533697866d 100644 --- a/mozilla/xpinstall/public/Makefile.in +++ b/mozilla/xpinstall/public/Makefile.in @@ -31,12 +31,13 @@ include $(DEPTH)/config/autoconf.mk MODULE = xpinstall +XPIDLSRCS = nsIXPInstallProgress.idl + EXPORTS = \ nsIDOMInstallTriggerGlobal.h \ nsIDOMInstallVersion.h \ nsSoftwareUpdateIIDs.h \ nsISoftwareUpdate.h \ - nsIXPInstallProgressNotifier.h \ $(NULL) EXPORTS := $(addprefix $(srcdir)/, $(EXPORTS)) diff --git a/mozilla/xpinstall/public/makefile.win b/mozilla/xpinstall/public/makefile.win index 75effcd7ff5..dbe1c16508d 100644 --- a/mozilla/xpinstall/public/makefile.win +++ b/mozilla/xpinstall/public/makefile.win @@ -22,17 +22,15 @@ # Daniel Veditz # Douglas Turner +MODULE=xpinstall DEPTH=..\.. -DEFINES=-D_IMPL_NS_DOM - EXPORTS= nsIDOMInstallTriggerGlobal.h \ nsIDOMInstallVersion.h \ nsSoftwareUpdateIIDs.h \ - nsISoftwareUpdate.h \ - nsIXPInstallProgressNotifier.h + nsISoftwareUpdate.h -MODULE=xpinstall +XPIDLSRCS = .\nsIXPInstallProgress.idl +include <$(DEPTH)\config\config.mak> include <$(DEPTH)\config\rules.mak> - diff --git a/mozilla/xpinstall/public/nsISoftwareUpdate.h b/mozilla/xpinstall/public/nsISoftwareUpdate.h index 5bd26e43ea1..3d56d32f8c1 100644 --- a/mozilla/xpinstall/public/nsISoftwareUpdate.h +++ b/mozilla/xpinstall/public/nsISoftwareUpdate.h @@ -30,7 +30,7 @@ #include "nsIFactory.h" #include "nsString.h" -#include "nsIXPInstallProgressNotifier.h" +#include "nsIXPInstallProgress.h" #define NS_IXPINSTALLCOMPONENT_PROGID NS_IAPPSHELLCOMPONENT_PROGID "/xpinstall" #define NS_IXPINSTALLCOMPONENT_CLASSNAME "Mozilla XPInstall Component" @@ -53,13 +53,13 @@ class nsISoftwareUpdate : public nsISupports const nsString& localFile, long flags) = 0; - NS_IMETHOD RegisterNotifier(nsIXPInstallProgressNotifier *notifier) = 0; + NS_IMETHOD RegisterNotifier(nsIXPInstallProgress *notifier) = 0; NS_IMETHOD InstallPending(void) = 0; /* FIX: these should be in a private interface */ NS_IMETHOD InstallJarCallBack() = 0; - NS_IMETHOD GetTopLevelNotifier(nsIXPInstallProgressNotifier **notifier) = 0; + NS_IMETHOD GetTopLevelNotifier(nsIXPInstallProgress **notifier) = 0; }; diff --git a/mozilla/xpinstall/src/makefile.win b/mozilla/xpinstall/src/makefile.win index cc9ec455295..9aa7a25de95 100644 --- a/mozilla/xpinstall/src/makefile.win +++ b/mozilla/xpinstall/src/makefile.win @@ -45,6 +45,7 @@ LINCS= \ -I$(PUBLIC)\netlib \ -I$(PUBLIC)\xpcom \ -I$(PUBLIC)\pref \ + -I$(PUBLIC)\rdf \ -I$(PUBLIC)\js \ -I$(PUBLIC)\dom \ -I$(PUBLIC)\raptor \ @@ -94,6 +95,7 @@ OBJS = \ .\$(OBJDIR)\nsWinProfile.obj \ .\$(OBJDIR)\nsJSWinProfile.obj \ .\$(OBJDIR)\nsWinProfileItem.obj \ + .\$(OBJDIR)\nsInstallProgressDialog.obj \ .\$(OBJDIR)\nsInstallFileOpItem.obj \ $(NULL) diff --git a/mozilla/xpinstall/src/nsInstall.cpp b/mozilla/xpinstall/src/nsInstall.cpp index 30d0d24ae35..112ad37cd60 100644 --- a/mozilla/xpinstall/src/nsInstall.cpp +++ b/mozilla/xpinstall/src/nsInstall.cpp @@ -156,7 +156,7 @@ nsInstallInfo::GetArguments(nsString& args, PRUint32 index) { nsString aURL = GetFromURL(index); - PRInt32 result = aURL.RFind('?'); + PRInt32 result = aURL.RFind("?"); if (result != -1) { aURL.Right(args, (aURL.Length() - result - 1) ); @@ -1621,7 +1621,7 @@ nsInstall::ExtractFileFromJar(const nsString& aJarfile, nsFileSpec* aSuggestedNa // Get the extention of the file in the jar. - PRInt32 result = aJarfile.RFind('.'); + PRInt32 result = aJarfile.RFind("."); if (result != -1) { // We found an extention. Add it to the tempfileName string diff --git a/mozilla/xpinstall/src/nsInstall.h b/mozilla/xpinstall/src/nsInstall.h index 6343ea874cf..1180a6f4ae5 100644 --- a/mozilla/xpinstall/src/nsInstall.h +++ b/mozilla/xpinstall/src/nsInstall.h @@ -44,7 +44,7 @@ #include "nsInstallObject.h" #include "nsInstallVersion.h" -#include "nsIXPInstallProgressNotifier.h" +#include "nsIXPInstallProgress.h" class nsInstallInfo @@ -235,7 +235,7 @@ class nsInstall nsVector* mInstalledFiles; nsHashtable* mPatchList; - nsIXPInstallProgressNotifier *mNotifier; + nsIXPInstallProgress *mNotifier; PRInt32 mLastError; diff --git a/mozilla/xpinstall/src/nsInstallTrigger.cpp b/mozilla/xpinstall/src/nsInstallTrigger.cpp index c47961a3516..0964fd75ff1 100644 --- a/mozilla/xpinstall/src/nsInstallTrigger.cpp +++ b/mozilla/xpinstall/src/nsInstallTrigger.cpp @@ -153,6 +153,8 @@ nsInstallTrigger::UpdateEnabled(PRBool* aReturn) *aReturn = PR_FALSE; /* no prefs manager. set to false */ } + //FIX!!!!!!!!!! + *aReturn = PR_TRUE; return NS_OK; } @@ -254,14 +256,14 @@ nsInstallTrigger::CreateTempFileFromURL(const nsString& aURL, nsString& tempFile { nsSpecialSystemDirectory tempFile(nsSpecialSystemDirectory::OS_TemporaryDirectory); - PRInt32 result = aURL.RFind('/'); + PRInt32 result = aURL.RFind("/"); if (result != -1) { nsString jarName; aURL.Right(jarName, (aURL.Length() - result) ); - PRInt32 argOffset = jarName.RFind('?'); + PRInt32 argOffset = jarName.RFind("?"); if (argOffset != -1) { diff --git a/mozilla/xpinstall/src/nsLoggingProgressNotifier.cpp b/mozilla/xpinstall/src/nsLoggingProgressNotifier.cpp index dffccaf8561..209c91e5d65 100644 --- a/mozilla/xpinstall/src/nsLoggingProgressNotifier.cpp +++ b/mozilla/xpinstall/src/nsLoggingProgressNotifier.cpp @@ -22,7 +22,7 @@ * Douglas Turner */ -#include "nsIXPInstallProgressNotifier.h" +#include "nsIXPInstallProgress.h" #include "nsLoggingProgressNotifier.h" #include "nsFileSpec.h" @@ -35,24 +35,28 @@ nsLoggingProgressNotifier::nsLoggingProgressNotifier() { + NS_INIT_REFCNT(); } nsLoggingProgressNotifier::~nsLoggingProgressNotifier() { } -void -nsLoggingProgressNotifier::BeforeJavascriptEvaluation(void) +NS_IMPL_ISUPPORTS(nsLoggingProgressNotifier, nsIXPInstallProgress::GetIID()); + +NS_IMETHODIMP +nsLoggingProgressNotifier::BeforeJavascriptEvaluation() { nsSpecialSystemDirectory logFile(nsSpecialSystemDirectory::OS_CurrentProcessDirectory); logFile += "Install.log"; mLogStream = new nsOutputFileStream(logFile, PR_WRONLY | PR_CREATE_FILE | PR_APPEND, 0744 ); mLogStream->seek(logFile.GetFileSize()); + return NS_OK; } -void -nsLoggingProgressNotifier::AfterJavascriptEvaluation(void) +NS_IMETHODIMP +nsLoggingProgressNotifier::AfterJavascriptEvaluation() { char* time; GetTime(&time); @@ -65,12 +69,14 @@ nsLoggingProgressNotifier::AfterJavascriptEvaluation(void) mLogStream->close(); delete mLogStream; mLogStream = nsnull; + + return NS_OK; } -void +NS_IMETHODIMP nsLoggingProgressNotifier::InstallStarted(const char* UIPackageName) { - if (mLogStream == nsnull) return; + if (mLogStream == nsnull) return -1; char* time; GetTime(&time); @@ -84,26 +90,28 @@ nsLoggingProgressNotifier::InstallStarted(const char* UIPackageName) PL_strfree(time); + return NS_OK; } -long +NS_IMETHODIMP nsLoggingProgressNotifier::ItemScheduled(const char* message ) { - return 0; + return NS_OK; } -void -nsLoggingProgressNotifier::InstallFinalization(const char* message, long itemNum, long totNum ) +NS_IMETHODIMP +nsLoggingProgressNotifier::InstallFinalization(const char* message, PRInt32 itemNum, PRInt32 totNum ) { - if (mLogStream == nsnull) return; + if (mLogStream == nsnull) return -1; *mLogStream << " Item [" << (itemNum+1) << "/" << totNum << "]\t" << message << nsEndl; + return NS_OK; } -void -nsLoggingProgressNotifier::InstallAborted(void) +NS_IMETHODIMP +nsLoggingProgressNotifier::InstallAborted() { - if (mLogStream == nsnull) return; + if (mLogStream == nsnull) return -1; char* time; GetTime(&time); @@ -111,6 +119,7 @@ nsLoggingProgressNotifier::InstallAborted(void) *mLogStream << " Aborted Installation at " << time << nsEndl << nsEndl; PL_strfree(time); + return NS_OK; } void diff --git a/mozilla/xpinstall/src/nsLoggingProgressNotifier.h b/mozilla/xpinstall/src/nsLoggingProgressNotifier.h index 0471be0af77..43903b927c0 100644 --- a/mozilla/xpinstall/src/nsLoggingProgressNotifier.h +++ b/mozilla/xpinstall/src/nsLoggingProgressNotifier.h @@ -27,23 +27,25 @@ #ifndef nsLoggingProgressNotifier_H__ #define nsLoggingProgressNotifier_H__ -#include "nsIXPInstallProgressNotifier.h" +#include "nsIXPInstallProgress.h" #include "nsFileStream.h" -class nsLoggingProgressNotifier : public nsIXPInstallProgressNotifier +class nsLoggingProgressNotifier : public nsIXPInstallProgress { public: nsLoggingProgressNotifier(); virtual ~nsLoggingProgressNotifier(); - - void BeforeJavascriptEvaluation(void); - void AfterJavascriptEvaluation(void); - void InstallStarted(const char* UIPackageName); - long ItemScheduled(const char* message ); - void InstallFinalization(const char* message, long itemNum, long totNum ); - void InstallAborted(void); + + NS_DECL_ISUPPORTS + + NS_IMETHOD BeforeJavascriptEvaluation(); + NS_IMETHOD AfterJavascriptEvaluation(); + NS_IMETHOD InstallStarted(const char* UIPackageName); + NS_IMETHOD ItemScheduled(const char* message ); + NS_IMETHOD InstallFinalization(const char* message, PRInt32 itemNum, PRInt32 totNum ); + NS_IMETHOD InstallAborted(); private: void GetTime(char** aString); diff --git a/mozilla/xpinstall/src/nsSoftwareUpdate.cpp b/mozilla/xpinstall/src/nsSoftwareUpdate.cpp index 33516444b27..4fd493cc83b 100644 --- a/mozilla/xpinstall/src/nsSoftwareUpdate.cpp +++ b/mozilla/xpinstall/src/nsSoftwareUpdate.cpp @@ -40,6 +40,7 @@ #include "nsTopProgressNotifier.h" #include "nsLoggingProgressNotifier.h" +#include "nsInstallProgressDialog.h" #include "nsIAppShellComponent.h" #include "nsIRegistry.h" @@ -54,6 +55,10 @@ #include "nsIScriptNameSpaceManager.h" #include "nsIScriptExternalNameSet.h" +#include "nsIEventQueueService.h" +#include "nsProxyObjectManager.h" + + //////////////////////////////////////////////////////////////////////////////// // Globals //////////////////////////////////////////////////////////////////////////////// @@ -76,8 +81,8 @@ static NS_DEFINE_IID(kInstallTrigger_CID, NS_SoftwareUpdateInstallTrigger_CID); static NS_DEFINE_IID(kIInstallVersion_IID, NS_IDOMINSTALLVERSION_IID); static NS_DEFINE_IID(kInstallVersion_CID, NS_SoftwareUpdateInstallVersion_CID); - - +static NS_DEFINE_IID(kProxyObjectManagerIID, NS_IPROXYEVENT_MANAGER_IID); +static NS_DEFINE_IID(kEventQueueServiceIID, NS_IEVENTQUEUESERVICE_IID); nsSoftwareUpdate::nsSoftwareUpdate() @@ -148,7 +153,56 @@ nsSoftwareUpdate::nsSoftwareUpdate() nsLoggingProgressNotifier *logger = new nsLoggingProgressNotifier(); RegisterNotifier(logger); + + nsIProxyObjectManager *manager; + nsInstallProgressDialog *dialog = new nsInstallProgressDialog(); + nsInstallProgressDialog *proxy; + nsISupports *dialogBase; + + nsresult rv = dialog->QueryInterface(kISupportsIID, (void**)&dialogBase); + + if (NS_SUCCEEDED(rv)) + { + rv = nsServiceManager::GetService( NS_XPCOMPROXY_PROGID, + kProxyObjectManagerIID, + (nsISupports **)&manager); + + if (NS_SUCCEEDED(rv)) + { + // I am assuming that the thread that starts us up is the UI thread. this will/may break + // I need to make a generic way of getting at the UI event queue. + + nsIEventQueueService *eventQService; + rv = nsServiceManager::GetService(NS_EVENTQUEUESERVICE_PROGID, + kEventQueueServiceIID, + (nsISupports **)&eventQService); + + + if (NS_SUCCEEDED(rv)) + { + nsIEventQueue *eventQ; + eventQService->GetThreadEventQueue(PR_GetCurrentThread(), &eventQ); + + PLEventQueue *plEventQ; + eventQ->GetPLEventQueue(&plEventQ); + + rv = manager->GetProxyObject(plEventQ, nsIXPInstallProgress::GetIID(), dialogBase, PROXY_SYNC, (void**)&proxy); + if (NS_SUCCEEDED(rv)) + { + RegisterNotifier(proxy); + } + } + } + } + + if (dialog) + dialog->Release(); } + + + + + nsSoftwareUpdate::~nsSoftwareUpdate() { #ifdef NS_DEBUG @@ -238,7 +292,7 @@ nsSoftwareUpdate::Shutdown() NS_IMETHODIMP -nsSoftwareUpdate::RegisterNotifier(nsIXPInstallProgressNotifier *notifier) +nsSoftwareUpdate::RegisterNotifier(nsIXPInstallProgress *notifier) { // we are going to ignore the returned ID and enforce that once you // register a notifier, you can not remove it. This should at some @@ -250,7 +304,7 @@ nsSoftwareUpdate::RegisterNotifier(nsIXPInstallProgressNotifier *notifier) } NS_IMETHODIMP -nsSoftwareUpdate::GetTopLevelNotifier(nsIXPInstallProgressNotifier **notifier) +nsSoftwareUpdate::GetTopLevelNotifier(nsIXPInstallProgress **notifier) { *notifier = mTopLevelObserver; return NS_OK; diff --git a/mozilla/xpinstall/src/nsSoftwareUpdate.h b/mozilla/xpinstall/src/nsSoftwareUpdate.h index 76c6626659c..c9a109dc8a6 100644 --- a/mozilla/xpinstall/src/nsSoftwareUpdate.h +++ b/mozilla/xpinstall/src/nsSoftwareUpdate.h @@ -15,7 +15,7 @@ class nsInstallInfo; #include "nsIScriptExternalNameSet.h" #include "nsIAppShellComponent.h" -#include "nsIXPInstallProgressNotifier.h" +#include "nsIXPInstallProgress.h" #include "nsTopProgressNotifier.h" class nsSoftwareUpdate: public nsIAppShellComponent, public nsISoftwareUpdate @@ -34,12 +34,12 @@ class nsSoftwareUpdate: public nsIAppShellComponent, public nsISoftwareUpdate const nsString& localFile, long flags); - NS_IMETHOD RegisterNotifier(nsIXPInstallProgressNotifier *notifier); + NS_IMETHOD RegisterNotifier(nsIXPInstallProgress *notifier); NS_IMETHOD InstallPending(void); NS_IMETHOD InstallJarCallBack(); - NS_IMETHOD GetTopLevelNotifier(nsIXPInstallProgressNotifier **notifier); + NS_IMETHOD GetTopLevelNotifier(nsIXPInstallProgress **notifier); private: diff --git a/mozilla/xpinstall/src/nsSoftwareUpdateRun.cpp b/mozilla/xpinstall/src/nsSoftwareUpdateRun.cpp index 81e7c433a3e..223d181b1c6 100644 --- a/mozilla/xpinstall/src/nsSoftwareUpdateRun.cpp +++ b/mozilla/xpinstall/src/nsSoftwareUpdateRun.cpp @@ -295,7 +295,7 @@ extern "C" void RunInstallOnThread(void *data) kISoftwareUpdateIID, (nsISupports**)&softwareUpdate); - nsIXPInstallProgressNotifier *notifier; + nsIXPInstallProgress *notifier; if (NS_SUCCEEDED(rv)) { diff --git a/mozilla/xpinstall/src/nsTopProgressNotifier.cpp b/mozilla/xpinstall/src/nsTopProgressNotifier.cpp index cedb9cdbc84..ccb488387f6 100644 --- a/mozilla/xpinstall/src/nsTopProgressNotifier.cpp +++ b/mozilla/xpinstall/src/nsTopProgressNotifier.cpp @@ -22,7 +22,7 @@ * Douglas Turner */ -#include "nsIXPInstallProgressNotifier.h" +#include "nsIXPInstallProgress.h" #include "nsTopProgressNotifier.h" nsTopProgressNotifier::nsTopProgressNotifier() @@ -37,7 +37,7 @@ nsTopProgressNotifier::~nsTopProgressNotifier() PRUint32 i=0; for (; i < mNotifiers->GetSize(); i++) { - nsIXPInstallProgressNotifier* element = (nsIXPInstallProgressNotifier*)mNotifiers->Get(i); + nsIXPInstallProgress* element = (nsIXPInstallProgress*)mNotifiers->Get(i); delete element; } @@ -46,8 +46,12 @@ nsTopProgressNotifier::~nsTopProgressNotifier() } } + +NS_IMPL_ISUPPORTS(nsTopProgressNotifier, nsIXPInstallProgress::GetIID()); + + long -nsTopProgressNotifier::RegisterNotifier(nsIXPInstallProgressNotifier * newNotifier) +nsTopProgressNotifier::RegisterNotifier(nsIXPInstallProgress * newNotifier) { return mNotifiers->Add( newNotifier ); } @@ -61,22 +65,24 @@ nsTopProgressNotifier::UnregisterNotifier(long id) -void -nsTopProgressNotifier::BeforeJavascriptEvaluation(void) +NS_IMETHODIMP +nsTopProgressNotifier::BeforeJavascriptEvaluation() { if (mNotifiers) { PRUint32 i=0; for (; i < mNotifiers->GetSize(); i++) { - nsIXPInstallProgressNotifier* element = (nsIXPInstallProgressNotifier*)mNotifiers->Get(i); + nsIXPInstallProgress* element = (nsIXPInstallProgress*)mNotifiers->Get(i); if (element != NULL) element->BeforeJavascriptEvaluation(); } } + + return NS_OK; } -void +NS_IMETHODIMP nsTopProgressNotifier::AfterJavascriptEvaluation(void) { if (mNotifiers) @@ -84,14 +90,15 @@ nsTopProgressNotifier::AfterJavascriptEvaluation(void) PRUint32 i=0; for (; i < mNotifiers->GetSize(); i++) { - nsIXPInstallProgressNotifier* element = (nsIXPInstallProgressNotifier*)mNotifiers->Get(i); + nsIXPInstallProgress* element = (nsIXPInstallProgress*)mNotifiers->Get(i); if (element != NULL) element->AfterJavascriptEvaluation(); } } + return NS_OK; } -void +NS_IMETHODIMP nsTopProgressNotifier::InstallStarted(const char* UIPackageName) { if (mNotifiers) @@ -99,14 +106,15 @@ nsTopProgressNotifier::InstallStarted(const char* UIPackageName) PRUint32 i=0; for (; i < mNotifiers->GetSize(); i++) { - nsIXPInstallProgressNotifier* element = (nsIXPInstallProgressNotifier*)mNotifiers->Get(i); + nsIXPInstallProgress* element = (nsIXPInstallProgress*)mNotifiers->Get(i); if (element != NULL) element->InstallStarted(UIPackageName); } } + return NS_OK; } -long +NS_IMETHODIMP nsTopProgressNotifier::ItemScheduled( const char* message ) { long rv = 0; @@ -116,7 +124,7 @@ nsTopProgressNotifier::ItemScheduled( const char* message ) PRUint32 i=0; for (; i < mNotifiers->GetSize(); i++) { - nsIXPInstallProgressNotifier* element = (nsIXPInstallProgressNotifier*)mNotifiers->Get(i); + nsIXPInstallProgress* element = (nsIXPInstallProgress*)mNotifiers->Get(i); if (element != NULL) if (element->ItemScheduled( message ) != 0) rv = -1; @@ -126,22 +134,23 @@ nsTopProgressNotifier::ItemScheduled( const char* message ) return rv; } -void -nsTopProgressNotifier::InstallFinalization( const char* message, long itemNum, long totNum ) +NS_IMETHODIMP +nsTopProgressNotifier::InstallFinalization( const char* message, PRInt32 itemNum, PRInt32 totNum ) { if (mNotifiers) { PRUint32 i=0; for (; i < mNotifiers->GetSize(); i++) { - nsIXPInstallProgressNotifier* element = (nsIXPInstallProgressNotifier*)mNotifiers->Get(i); + nsIXPInstallProgress* element = (nsIXPInstallProgress*)mNotifiers->Get(i); if (element != NULL) element->InstallFinalization( message, itemNum, totNum ); } } + return NS_OK; } -void +NS_IMETHODIMP nsTopProgressNotifier::InstallAborted(void) { if (mNotifiers) @@ -149,11 +158,12 @@ nsTopProgressNotifier::InstallAborted(void) PRUint32 i=0; for (; i < mNotifiers->GetSize(); i++) { - nsIXPInstallProgressNotifier* element = (nsIXPInstallProgressNotifier*)mNotifiers->Get(i); + nsIXPInstallProgress* element = (nsIXPInstallProgress*)mNotifiers->Get(i); if (element != NULL) element->InstallAborted(); } } + return NS_OK; } diff --git a/mozilla/xpinstall/src/nsTopProgressNotifier.h b/mozilla/xpinstall/src/nsTopProgressNotifier.h index cb02217d266..86332258bab 100644 --- a/mozilla/xpinstall/src/nsTopProgressNotifier.h +++ b/mozilla/xpinstall/src/nsTopProgressNotifier.h @@ -25,26 +25,29 @@ #ifndef nsTopProgressNotifier_h__ #define nsTopProgressNotifier_h__ -#include "nsIXPInstallProgressNotifier.h" +#include "nsIXPInstallProgress.h" #include "nsVector.h" -class nsTopProgressNotifier : public nsIXPInstallProgressNotifier +class nsTopProgressNotifier : public nsIXPInstallProgress { public: nsTopProgressNotifier(); virtual ~nsTopProgressNotifier(); - long RegisterNotifier(nsIXPInstallProgressNotifier * newNotifier); + long RegisterNotifier(nsIXPInstallProgress * newNotifier); void UnregisterNotifier(long id); - void BeforeJavascriptEvaluation(void); - void AfterJavascriptEvaluation(void); - void InstallStarted(const char* UIPackageName); - long ItemScheduled(const char* message ); - void InstallFinalization(const char* message, long itemNum, long totNum ); - void InstallAborted(void); + NS_DECL_ISUPPORTS + + + NS_IMETHOD BeforeJavascriptEvaluation(); + NS_IMETHOD AfterJavascriptEvaluation(); + NS_IMETHOD InstallStarted(const char* UIPackageName); + NS_IMETHOD ItemScheduled(const char* message ); + NS_IMETHOD InstallFinalization(const char* message, PRInt32 itemNum, PRInt32 totNum ); + NS_IMETHOD InstallAborted(); private: nsVector *mNotifiers;