mirror of
https://github.com/HeyPuter/firefox.git
synced 2026-11-25 11:37:43 -10:00
adding update notification to xpinstall. It is currently ifdef off.
This commit is contained in:
1 parent
e0744d78dc
commit
112715829c
3 files changed
+50
-1
No files matched your search
@@ -1,3 +1,4 @@
|
||||
|
||||
#!nmake
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public
|
||||
@@ -86,6 +87,7 @@ OBJS = \
|
||||
.\$(OBJDIR)\nsInstallFileOpItem.obj \
|
||||
.\$(OBJDIR)\nsWinShortcut.obj \
|
||||
.\$(OBJDIR)\nsJSFileSpecObj.obj \
|
||||
# .\$(OBJDIR)\nsUpdateNotification.obj \
|
||||
$(NULL)
|
||||
|
||||
WIN_LIBS= \
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public
|
||||
@@ -89,10 +90,15 @@ static NS_DEFINE_CID(kInstallVersion_CID, NS_SoftwareUpdateInstallVersion_CID);
|
||||
|
||||
static NS_DEFINE_CID(knsRegistryCID, NS_REGISTRY_CID);
|
||||
|
||||
|
||||
nsSoftwareUpdate* nsSoftwareUpdate::mInstance = nsnull;
|
||||
nsIFileSpec* nsSoftwareUpdate::mProgramDir = nsnull;
|
||||
|
||||
#if NOTIFICATION_ENABLE
|
||||
#include "nsUpdateNotification.h"
|
||||
static NS_DEFINE_CID(kUpdateNotificationCID, NS_XPI_UPDATE_NOTIFIER_CID);
|
||||
nsIUpdateNotification* nsSoftwareUpdate::mUpdateNotifier= nsnull;
|
||||
#endif
|
||||
|
||||
|
||||
nsSoftwareUpdate *
|
||||
nsSoftwareUpdate::GetInstance()
|
||||
@@ -226,13 +232,33 @@ nsSoftwareUpdate::Initialize( nsIAppShellService *anAppShell, nsICmdLineService
|
||||
|
||||
nsLoggingProgressNotifier *logger = new nsLoggingProgressNotifier();
|
||||
RegisterNotifier(logger);
|
||||
|
||||
#if NOTIFICATION_ENABLE
|
||||
/***************************************/
|
||||
/* Create a Update notification object */
|
||||
/***************************************/
|
||||
NS_IF_RELEASE(mUpdateNotifier);
|
||||
|
||||
nsComponentManager::CreateInstance(kUpdateNotificationCID,
|
||||
nsnull,
|
||||
NS_GET_IID(nsIUpdateNotification),
|
||||
(void**)&mUpdateNotifier);
|
||||
|
||||
#endif
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSoftwareUpdate::Shutdown()
|
||||
{
|
||||
#if NOTIFICATION_ENABLED
|
||||
if (mUpdateNotifier)
|
||||
{
|
||||
mUpdateNotifier->DisplayUpdateDialog();
|
||||
NS_RELEASE(mUpdateNotifier);
|
||||
}
|
||||
#endif
|
||||
|
||||
// nothing to do here. Should we UnregisterService?
|
||||
return NS_OK;
|
||||
}
|
||||
@@ -612,6 +638,15 @@ static nsModuleComponentInfo components[] =
|
||||
NS_INSTALLVERSIONCOMPONENT_PROGID,
|
||||
nsInstallVersionConstructor
|
||||
},
|
||||
|
||||
#if NOTIFICATION_ENABLED
|
||||
{ "XPInstall Update Notifier",
|
||||
NS_XPI_UPDATE_NOTIFIER_CID,
|
||||
NS_XPI_UPDATE_NOTIFIER_PROGID,
|
||||
nsXPINotifierImpl::New
|
||||
},
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -22,6 +22,11 @@ class nsInstallInfo;
|
||||
#include "nsPIXPIStubHook.h"
|
||||
#include "nsTopProgressNotifier.h"
|
||||
|
||||
#if NOTIFICATION_ENABLE
|
||||
#include "nsIUpdateNotification.h"
|
||||
#endif
|
||||
|
||||
|
||||
#define XPI_ROOT_KEY "software/mozilla/xpinstall"
|
||||
#define XPI_AUTOREG_VAL "Autoreg"
|
||||
#define XPCOM_KEY "software/mozilla/XPCOM"
|
||||
@@ -73,6 +78,10 @@ class nsSoftwareUpdate: public nsIAppShellComponent,
|
||||
static nsSoftwareUpdate* mInstance;
|
||||
static nsIFileSpec* mProgramDir;
|
||||
|
||||
#if NOTIFICATION_ENABLE
|
||||
static nsIUpdateNotification *mUpdateNotifier;
|
||||
#endif
|
||||
|
||||
nsresult RunNextInstall();
|
||||
nsresult RegisterNameset();
|
||||
|
||||
@@ -83,6 +92,9 @@ class nsSoftwareUpdate: public nsIAppShellComponent,
|
||||
nsTopProgressNotifier mMasterNotifier;
|
||||
|
||||
HREG mReg;
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user