Bug 182359 only open one manager window of each type r=dwitte sr=darin

This commit is contained in:
neil%parkwaycc.co.uk 2006-07-27 14:58:01 +00:00
Родитель c3ba49798c
Коммит c85ee0d70d
1 изменённых файлов: 19 добавлений и 8 удалений

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

@ -16,24 +16,35 @@
* Reserved.
*
* Contributor(s):
* Neil Rashbrook <neil@parkwaycc.co.uk>
*/
var COOKIEPERMISSION = 0;
var IMAGEPERMISSION = 1;
function openCookieViewer(viewerType)
{
const wm = Components.classes["@mozilla.org/appshell/window-mediator;1"]
.getService(Components.interfaces.nsIWindowMediator);
var enumerator = wm.getEnumerator("mozilla:cookieviewer");
while (enumerator.hasMoreElements()) {
var viewer = enumerator.getNext();
if (viewer.arguments[0] == viewerType) {
viewer.focus();
return;
}
}
window.openDialog("chrome://communicator/content/wallet/CookieViewer.xul",
"_blank", "chrome,resizable", viewerType);
}
function viewImages() {
window.openDialog("chrome://communicator/content/wallet/CookieViewer.xul","_blank",
"chrome,resizable=yes", "imageManager" );
openCookieViewer("imageManager");
}
function viewCookies() {
window.openDialog("chrome://communicator/content/wallet/CookieViewer.xul","_blank",
"chrome,resizable=yes", "cookieManager");
openCookieViewer("cookieManager");
}
function viewCookiesFromIcon() {
window.openDialog("chrome://communicator/content/wallet/CookieViewer.xul","_blank",
"chrome,resizable=yes", "cookieManagerFromIcon");
openCookieViewer("cookieManagerFromIcon");
}
function viewP3P() {