Bug 784805 - Add a name field to mozIApplication and set it from the manifest r=fabrice

This commit is contained in:
Dave Hylands 2012-09-10 21:30:10 -07:00
Родитель ed8da5c11e
Коммит c2faa7ed89
3 изменённых файлов: 7 добавлений и 1 удалений

Просмотреть файл

@ -24,6 +24,7 @@ let AppsUtils = {
// Clones a app, without the manifest. // Clones a app, without the manifest.
cloneAppObject: function cloneAppObject(aApp) { cloneAppObject: function cloneAppObject(aApp) {
return { return {
name: aApp.name,
installOrigin: aApp.installOrigin, installOrigin: aApp.installOrigin,
origin: aApp.origin, origin: aApp.origin,
receipts: aApp.receipts ? JSON.parse(JSON.stringify(aApp.receipts)) : null, receipts: aApp.receipts ? JSON.parse(JSON.stringify(aApp.receipts)) : null,

Просмотреть файл

@ -179,6 +179,7 @@ let DOMApplicationRegistry = {
let app = this.webapps[aId]; let app = this.webapps[aId];
this._readManifests([{ id: aId }], (function registerManifest(aResult) { this._readManifests([{ id: aId }], (function registerManifest(aResult) {
let manifest = aResult[0].manifest; let manifest = aResult[0].manifest;
app.name = manifest.name;
this._registerSystemMessages(manifest, app); this._registerSystemMessages(manifest, app);
this._registerActivities(manifest, app); this._registerActivities(manifest, app);
}).bind(this)); }).bind(this));
@ -368,6 +369,7 @@ let DOMApplicationRegistry = {
this.webapps[id] = appObject; this.webapps[id] = appObject;
appObject.status = "installed"; appObject.status = "installed";
appObject.name = app.manifest.name;
let manifest = new DOMApplicationManifest(app.manifest, app.origin); let manifest = new DOMApplicationManifest(app.manifest, app.origin);

Просмотреть файл

@ -11,7 +11,7 @@
* We expose Gecko-internal helpers related to "web apps" through this * We expose Gecko-internal helpers related to "web apps" through this
* sub-interface. * sub-interface.
*/ */
[scriptable, uuid(764e8930-ff06-4f23-9a6a-8523b93ac09f)] [scriptable, uuid(efe22f80-f973-11e1-8a00-b7888ac0d2b9)]
interface mozIApplication: mozIDOMApplication interface mozIApplication: mozIDOMApplication
{ {
/* Return true if this app has |permission|. */ /* Return true if this app has |permission|. */
@ -22,4 +22,7 @@ interface mozIApplication: mozIDOMApplication
/* Returns the local id of the app (not the uuid used for sync). */ /* Returns the local id of the app (not the uuid used for sync). */
readonly attribute unsigned long localId; readonly attribute unsigned long localId;
/* Name copied from the manifest */
readonly attribute DOMString name;
}; };