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
parent 0c56f5bc04
commit 7d713cabde
3 changed files with 7 additions and 1 deletions

View File

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

View File

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

View File

@ -11,7 +11,7 @@
* We expose Gecko-internal helpers related to "web apps" through this
* sub-interface.
*/
[scriptable, uuid(764e8930-ff06-4f23-9a6a-8523b93ac09f)]
[scriptable, uuid(efe22f80-f973-11e1-8a00-b7888ac0d2b9)]
interface mozIApplication: mozIDOMApplication
{
/* 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). */
readonly attribute unsigned long localId;
/* Name copied from the manifest */
readonly attribute DOMString name;
};