Skip to content
This repository has been archived by the owner on Feb 26, 2022. It is now read-only.

Commit

Permalink
Bug 580387 - widget module should use xpcom.makeUuid() rather than XP…
Browse files Browse the repository at this point in the history
…COM. r=dietrich, a=myk
  • Loading branch information
0c0w3 committed Jul 20, 2010
1 parent 74eae8e commit e4184b7
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions packages/jetpack-core/lib/widget.js
Expand Up @@ -353,7 +353,7 @@ BrowserWindow.prototype = {
addItems: function BW_addItems(items) {
items.forEach(this._addItemToWindow, this);
},

// Update a property of a widget.
updateItem: function BW_updateItem(updatedItem, property, value) {
let item = this._items.filter(function(item) item.widget == updatedItem).shift();
Expand All @@ -370,14 +370,12 @@ BrowserWindow.prototype = {
}
}
},

// Add a widget to this window.
_addItemToWindow: function BW__addItemToWindow(widget) {
// XUL element container for widget
let node = this.doc.createElement("toolbaritem");
let guid = Cc["@mozilla.org/uuid-generator;1"].
getService(Ci.nsIUUIDGenerator).
generateUUID().toString();
let guid = require("xpcom").makeUuid().toString();
let id = "widget: " + guid;
node.setAttribute("id", id);
node.setAttribute("label", widget.label);
Expand Down

0 comments on commit e4184b7

Please sign in to comment.