2007-03-22 10:30:00 -07:00
|
|
|
/* ***** BEGIN LICENSE BLOCK *****
|
|
|
|
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
|
|
|
*
|
|
|
|
* The contents of this file are subject to the Mozilla Public License Version
|
|
|
|
* 1.1 (the "License"); you may not use this file except in compliance with
|
|
|
|
* the License. You may obtain a copy of the License at
|
|
|
|
* http://www.mozilla.org/MPL/
|
|
|
|
*
|
|
|
|
* Software distributed under the License is distributed on an "AS IS" basis,
|
|
|
|
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
|
|
|
* for the specific language governing rights and limitations under the
|
|
|
|
* License.
|
|
|
|
*
|
|
|
|
* The Original Code is Mozilla Communicator client code, released
|
|
|
|
* March 31, 1998.
|
|
|
|
*
|
|
|
|
* The Initial Developer of the Original Code is
|
|
|
|
* Netscape Communications Corporation.
|
|
|
|
* Portions created by the Initial Developer are Copyright (C) 1998
|
|
|
|
* the Initial Developer. All Rights Reserved.
|
|
|
|
*
|
|
|
|
* Contributor(s):
|
|
|
|
* Daniel Veditz <dveditz@netscape.com>
|
2008-01-29 18:00:45 -08:00
|
|
|
* Dave Townsend <dtownsend@oxymoronical.com>
|
2007-03-22 10:30:00 -07:00
|
|
|
*
|
|
|
|
* Alternatively, the contents of this file may be used under the terms of
|
|
|
|
* either of the GNU General Public License Version 2 or later (the "GPL"),
|
|
|
|
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
|
|
|
* in which case the provisions of the GPL or the LGPL are applicable instead
|
|
|
|
* of those above. If you wish to allow use of your version of this file only
|
|
|
|
* under the terms of either the GPL or the LGPL, and not to allow others to
|
|
|
|
* use your version of this file under the terms of the MPL, indicate your
|
|
|
|
* decision by deleting the provisions above and replace them with the notice
|
|
|
|
* and other provisions required by the GPL or the LGPL. If you do not delete
|
|
|
|
* the provisions above, a recipient may use your version of this file under
|
|
|
|
* the terms of any one of the MPL, the GPL or the LGPL.
|
|
|
|
*
|
|
|
|
* ***** END LICENSE BLOCK ***** */
|
|
|
|
|
|
|
|
#ifndef _NS_XPINSTALLMANAGER_H
|
|
|
|
#define _NS_XPINSTALLMANAGER_H
|
|
|
|
|
|
|
|
#include "nsInstall.h"
|
|
|
|
|
|
|
|
#include "nscore.h"
|
|
|
|
#include "nsISupports.h"
|
|
|
|
#include "nsString.h"
|
|
|
|
|
|
|
|
#include "nsIURL.h"
|
|
|
|
#include "nsIInputStream.h"
|
|
|
|
#include "nsIStreamListener.h"
|
|
|
|
#include "nsIXPInstallManager.h"
|
|
|
|
#include "nsIXPIDialogService.h"
|
|
|
|
#include "nsXPITriggerInfo.h"
|
|
|
|
#include "nsIXPIProgressDialog.h"
|
|
|
|
#include "nsIChromeRegistry.h"
|
|
|
|
#include "nsIDOMWindowInternal.h"
|
|
|
|
#include "nsIObserver.h"
|
2007-10-03 04:47:26 -07:00
|
|
|
#include "nsIBadCertListener2.h"
|
2008-02-07 03:54:05 -08:00
|
|
|
#include "nsISSLErrorListener.h"
|
2007-08-28 11:01:37 -07:00
|
|
|
#include "nsIChannelEventSink.h"
|
2008-01-29 18:00:45 -08:00
|
|
|
#include "nsIZipReader.h"
|
2007-08-31 12:29:18 -07:00
|
|
|
#include "nsIXPIInstallInfo.h"
|
2008-11-28 12:49:07 -08:00
|
|
|
#include "nsILoadGroup.h"
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
#include "nsCOMPtr.h"
|
|
|
|
|
|
|
|
#include "nsIProgressEventSink.h"
|
|
|
|
#include "nsIInterfaceRequestor.h"
|
|
|
|
#include "nsIInterfaceRequestorUtils.h"
|
|
|
|
|
|
|
|
#include "nsIDialogParamBlock.h"
|
|
|
|
|
|
|
|
#include "nsPICertNotification.h"
|
|
|
|
|
|
|
|
#include "nsWeakReference.h"
|
|
|
|
|
|
|
|
#define NS_XPIDIALOGSERVICE_CONTRACTID "@mozilla.org/embedui/xpinstall-dialog-service;1"
|
|
|
|
#define NS_XPINSTALLMANAGERCOMPONENT_CONTRACTID "@mozilla.org/xpinstall/install-manager;1"
|
|
|
|
#define XPI_PROGRESS_TOPIC "xpinstall-progress"
|
|
|
|
|
2008-01-29 18:00:45 -08:00
|
|
|
class nsXPInstallManager : public nsIXPIDialogService,
|
2007-03-22 10:30:00 -07:00
|
|
|
public nsIXPInstallManager,
|
|
|
|
public nsIObserver,
|
|
|
|
public nsIStreamListener,
|
|
|
|
public nsIProgressEventSink,
|
|
|
|
public nsIInterfaceRequestor,
|
|
|
|
public nsPICertNotification,
|
2007-10-03 04:47:26 -07:00
|
|
|
public nsIBadCertListener2,
|
2008-02-07 03:54:05 -08:00
|
|
|
public nsISSLErrorListener,
|
2007-08-28 11:01:37 -07:00
|
|
|
public nsIChannelEventSink,
|
2007-03-22 10:30:00 -07:00
|
|
|
public nsSupportsWeakReference
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
nsXPInstallManager();
|
|
|
|
virtual ~nsXPInstallManager();
|
|
|
|
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
NS_DECL_NSIXPIDIALOGSERVICE
|
|
|
|
NS_DECL_NSIXPINSTALLMANAGER
|
|
|
|
NS_DECL_NSIOBSERVER
|
|
|
|
NS_DECL_NSISTREAMLISTENER
|
|
|
|
NS_DECL_NSIPROGRESSEVENTSINK
|
|
|
|
NS_DECL_NSIREQUESTOBSERVER
|
|
|
|
NS_DECL_NSIINTERFACEREQUESTOR
|
|
|
|
NS_DECL_NSPICERTNOTIFICATION
|
2007-10-03 04:47:26 -07:00
|
|
|
NS_DECL_NSIBADCERTLISTENER2
|
2008-02-07 03:54:05 -08:00
|
|
|
NS_DECL_NSISSLERRORLISTENER
|
2007-08-28 11:01:37 -07:00
|
|
|
NS_DECL_NSICHANNELEVENTSINK
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2007-08-31 12:29:18 -07:00
|
|
|
NS_IMETHOD InitManager(nsIDOMWindowInternal* aParentWindow, nsXPITriggerInfo* aTrigger, PRUint32 aChromeType );
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
private:
|
|
|
|
nsresult InitManagerInternal();
|
2008-01-29 18:00:45 -08:00
|
|
|
nsresult InstallItems();
|
2007-03-22 10:30:00 -07:00
|
|
|
NS_IMETHOD DownloadNext();
|
2008-01-27 15:43:17 -08:00
|
|
|
void Shutdown(PRInt32 status = nsInstall::USER_CANCELLED);
|
2007-03-22 10:30:00 -07:00
|
|
|
NS_IMETHOD GetDestinationFile(nsString& url, nsILocalFile* *file);
|
|
|
|
NS_IMETHOD LoadParams(PRUint32 aCount, const PRUnichar** aPackageList, nsIDialogParamBlock** aParams);
|
|
|
|
#ifdef ENABLE_SKIN_SIMPLE_INSTALLATION_UI
|
|
|
|
PRBool ConfirmChromeInstall(nsIDOMWindowInternal* aParentWindow, const PRUnichar** aPackage);
|
|
|
|
#endif
|
|
|
|
PRBool VerifyHash(nsXPITriggerItem* aItem);
|
|
|
|
PRInt32 GetIndexFromURL(const PRUnichar* aUrl);
|
2007-08-28 11:01:37 -07:00
|
|
|
nsresult CheckCert(nsIChannel* aChannel);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
nsXPITriggerInfo* mTriggers;
|
|
|
|
nsXPITriggerItem* mItem;
|
|
|
|
PRUint32 mNextItem;
|
|
|
|
PRUint32 mChromeType;
|
2010-08-30 13:20:39 -07:00
|
|
|
PRInt32 mContentLength;
|
2007-03-22 10:30:00 -07:00
|
|
|
PRInt32 mOutstandingCertLoads;
|
|
|
|
PRBool mDialogOpen;
|
|
|
|
PRBool mCancelled;
|
|
|
|
PRBool mNeedsShutdown;
|
2007-08-28 11:01:37 -07:00
|
|
|
PRBool mFromChrome;
|
2008-01-29 18:00:45 -08:00
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
nsCOMPtr<nsIXPIProgressDialog> mDlg;
|
|
|
|
|
|
|
|
nsCOMPtr<nsIDOMWindowInternal> mParentWindow;
|
2008-11-28 12:49:07 -08:00
|
|
|
nsCOMPtr<nsILoadGroup> mLoadGroup;
|
2007-03-22 10:30:00 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|