зеркало из https://github.com/mozilla/pjs.git
Add new Update Manager interface and service to track current and past updates
This commit is contained in:
Родитель
8f5a8cd794
Коммит
a3ffbc7486
|
@ -29,6 +29,8 @@
|
|||
<!ENTITY checkNow.label "Check Now...">
|
||||
<!ENTITY appCheckNow.accesskey "C">
|
||||
<!ENTITY extensionsCheckNow.accesskey "h">
|
||||
<!ENTITY showUpdates.label "Show Updates">
|
||||
<!ENTITY showUpdates.accesskey "U">
|
||||
|
||||
<!ENTITY securityTab.label "Security">
|
||||
<!ENTITY protocols.label "Protocols">
|
||||
|
|
|
@ -265,6 +265,7 @@ var gDownloadingPage = {
|
|||
update.setAttribute("name", "Firefox 1.0.4");
|
||||
update.setAttribute("status", "Blah");
|
||||
update.setAttribute("url", "http://www.bengoodger.com/");
|
||||
update.setAttribute("mode", "normal");
|
||||
update.id = "activeDownloadItem";
|
||||
var updatesView = document.getElementById("updatesView");
|
||||
updatesView.appendChild(update);
|
||||
|
|
|
@ -72,7 +72,7 @@
|
|||
<xul:label class="update-item-name" xbl:inherits="value=name" crop="right" flex="1"/>
|
||||
<xul:link class="update-item-details" xbl:inherits="href=url" label="&details.link;"/>
|
||||
</xul:hbox>
|
||||
<xul:progressmeter class="update-item-progress" xbl:inherits="value=progress"/>
|
||||
<xul:progressmeter class="update-item-progress" xbl:inherits="value=progress" mode="undetermined"/>
|
||||
<xul:hbox align="center">
|
||||
<xul:label class="update-item-status" xbl:inherits="value=status" flex="1" crop="right"/>
|
||||
<xul:button class="update-item-pause"
|
||||
|
|
|
@ -39,6 +39,7 @@
|
|||
|
||||
interface nsIRequest;
|
||||
interface nsIRequestObserver;
|
||||
interface nsISimpleEnumerator;
|
||||
interface nsITimerCallback;
|
||||
|
||||
[scriptable, uuid(56863a67-bd69-42de-9f40-583e625b457d)]
|
||||
|
@ -71,23 +72,36 @@ interface nsIUpdatePatch : nsISupports
|
|||
interface nsIUpdate : nsISupports
|
||||
{
|
||||
/**
|
||||
*
|
||||
* The type of update:
|
||||
* "major" A major new version of the Application
|
||||
* "minor" A minor update to the Application (e.g. security update)
|
||||
*/
|
||||
attribute AString type;
|
||||
|
||||
/**
|
||||
*
|
||||
* The Application version of this update.
|
||||
*/
|
||||
attribute AString version;
|
||||
|
||||
/**
|
||||
*
|
||||
* The Addon version of this update. Used by the Extension System to track
|
||||
* compatibility of installed addons with this update.
|
||||
*/
|
||||
attribute AString extensionversion;
|
||||
|
||||
/**
|
||||
*
|
||||
* The URL to a page which offers details about the content of this
|
||||
* update. Ideally, this page is not the release notes but some other page
|
||||
* that summarizes the differences between this update and the previous,
|
||||
* which also links to the release notes.
|
||||
*/
|
||||
attribute AString detailsurl;
|
||||
|
||||
/**
|
||||
*
|
||||
* The URL to a HTML fragment that contains a license for this update. If
|
||||
* this is specified, the user is shown the license file after they choose
|
||||
* to install the update and they must agree to it before the download
|
||||
* commences.
|
||||
*/
|
||||
attribute AString licenseurl;
|
||||
|
||||
|
@ -99,11 +113,20 @@ interface nsIUpdate : nsISupports
|
|||
attribute boolean isCompleteUpdate;
|
||||
|
||||
/**
|
||||
*
|
||||
* When the update was installed.
|
||||
*/
|
||||
attribute long long installDate;
|
||||
|
||||
/**
|
||||
* The number of patches supplied by this update.
|
||||
*/
|
||||
readonly attribute unsigned long patchCount;
|
||||
|
||||
/**
|
||||
*
|
||||
* Retrieves a patch.
|
||||
* @param index
|
||||
* The index of the patch to retrieve.
|
||||
* @returns The nsIUpdatePatch at the specified index.
|
||||
*/
|
||||
nsIUpdatePatch getPatchAt(in unsigned long index);
|
||||
};
|
||||
|
@ -210,6 +233,35 @@ interface nsIApplicationUpdateService : nsISupports
|
|||
void pauseDownload();
|
||||
};
|
||||
|
||||
[scriptable, uuid(fede66a9-9f96-4507-a22a-775ee885577e)]
|
||||
interface nsIUpdateManager : nsISupports
|
||||
{
|
||||
/**
|
||||
*
|
||||
*/
|
||||
readonly attribute nsISimpleEnumerator updates;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
attribute nsIUpdate activeUpdate;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
void addUpdate(in nsIUpdate update);
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
void removeUpdate(in nsIUpdate update);
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
void saveUpdates();
|
||||
};
|
||||
|
||||
[scriptable, uuid(0765c92c-6145-4253-9db4-594d8023087e)]
|
||||
interface nsIUpdateTimerManager : nsISupports
|
||||
{
|
||||
|
|
|
@ -621,6 +621,53 @@ UpdateService.prototype = {
|
|||
}
|
||||
};
|
||||
|
||||
function UpdateManager() {
|
||||
}
|
||||
UpdateManager.prototype = {
|
||||
/**
|
||||
* See nsIUpdateService.idl
|
||||
*/
|
||||
get updates() {
|
||||
},
|
||||
|
||||
/**
|
||||
* See nsIUpdateService.idl
|
||||
*/
|
||||
get activeUpdate() {
|
||||
},
|
||||
set activeUpdate(activeUpdate) {
|
||||
},
|
||||
|
||||
/**
|
||||
* See nsIUpdateService.idl
|
||||
*/
|
||||
addUpdate: function(update) {
|
||||
},
|
||||
|
||||
/**
|
||||
* See nsIUpdateService.idl
|
||||
*/
|
||||
removeUpdate: function(update) {
|
||||
},
|
||||
|
||||
/**
|
||||
* See nsIUpdateService.idl
|
||||
*/
|
||||
saveUpdates: function() {
|
||||
},
|
||||
|
||||
/**
|
||||
* See nsISupports.idl
|
||||
*/
|
||||
QueryInterface: function(iid) {
|
||||
if (!iid.equals(Components.interfaces.nsIUpdateManager) &&
|
||||
!iid.equals(Components.interfaces.nsISupports))
|
||||
throw Components.results.NS_ERROR_NO_INTERFACE;
|
||||
return this;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Gets a preference value, handling the case where there is no default.
|
||||
* @param func
|
||||
|
@ -1396,6 +1443,11 @@ var gModule = {
|
|||
className : "Update Service",
|
||||
factory : #1#(UpdateService)
|
||||
},
|
||||
manager: { CID : Components.ID("{093C2356-4843-4C65-8709-D7DBCBBE7DFB}"),
|
||||
contractID : "@mozilla.org/updates/update-manager;1",
|
||||
className : "Update Manager",
|
||||
factory : #1#(UpdateManager)
|
||||
},
|
||||
prompt: { CID : Components.ID("{27ABA825-35B5-4018-9FDD-F99250A0E722}"),
|
||||
contractID : "@mozilla.org/updates/update-prompt;1",
|
||||
className : "Update Prompt",
|
||||
|
|
Загрузка…
Ссылка в новой задаче