rem: var oldTheme = false; try { oldTheme = !chromeRegistry.checkThemeVersion(data.name); } catch(e) { }   var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"].getService(Components.interfaces.nsIPromptService); if (oldTheme) { var title = gNavigatorBundle.getString("oldthemetitle"); var message = gNavigatorBundle.getString("oldTheme");  message = message.replace(/%theme_name%/, themeName.getAttribute("displayName")); message = message.replace(/%brand%/g, gBrandBundle.getString("brandShortName"));  if (promptService.confirm(window, title, message)){ var inUse = chromeRegistry.isSkinSelected(data.name, true);  chromeRegistry.uninstallSkin(data.name, true);  var str = Components.classes["@mozilla.org/supports-string;1"] .createInstance(Components.interfaces.nsISupportsString);  str.data = true; pref.setComplexValue("general.skins.removelist." + data.name, Components.interfaces.nsISupportsString, str);  if (inUse) chromeRegistry.refreshSkins(); list.selectedIndex = 0; }  return; }  
context: function applyTheme(){  var data = parent.hPrefWindow.wsm.dataManager.pageData["chrome://browser/content/pref/pref-themes.xul"].userData;  if (data.name == null)    return;  const kPrefSvcContractID = "@mozilla.org/preferences;1";  const kPrefSvcIID = Components.interfaces.nsIPref;  var prefSvc = Components.classes[kPrefSvcContractID].getService(kPrefSvcIID);  var theme = null;  try {    theme = prefSvc.getComplexValue("general.skins.selectedSkin",                                     Components.interfaces.nsISupportsString).data;  } catch (e) {  }  if (theme == data.name) return;  try {    var reg = Components.classes["@mozilla.org/chrome/chrome-registry;1"].getService();    if (reg)      reg = reg.QueryInterface(Components.interfaces.nsIXULChromeRegistry);  }  catch(e) {}  var inUse = reg.isSkinSelected(data.name, true);  if (!theme && inUse == Components.interfaces.nsIChromeRegistry.FULL) return;  var chromeRegistry = Components.classes["@mozilla.org/chrome/chrome-registry;1"]    .getService(Components.interfaces.nsIXULChromeRegistry);  var oldTheme = false;  try {    oldTheme = !chromeRegistry.checkThemeVersion(data.name);  }  catch(e) {  }  var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"].getService(Components.interfaces.nsIPromptService);  if (oldTheme) {    var title = gNavigatorBundle.getString("oldthemetitle");    var message = gNavigatorBundle.getString("oldTheme");        message = message.replace(/%theme_name%/, themeName.getAttribute("displayName"));    message = message.replace(/%brand%/g, gBrandBundle.getString("brandShortName"));    if (promptService.confirm(window, title, message)){      var inUse = chromeRegistry.isSkinSelected(data.name, true);      chromeRegistry.uninstallSkin(data.name, true);      var str = Components.classes["@mozilla.org/supports-string;1"]                          .createInstance(Components.interfaces.nsISupportsString);      str.data = true;      pref.setComplexValue("general.skins.removelist." + data.name,                           Components.interfaces.nsISupportsString, str);            if (inUse)        chromeRegistry.refreshSkins();    list.selectedIndex = 0;    }    return;  }  var str = Components.classes["@mozilla.org/supports-string;1"]                      .createInstance(Components.interfaces.nsISupportsString);  str.data = data.name;  prefSvc.setComplexValue("general.skins.selectedSkin", Components.interfaces.nsISupportsString, str);  chromeRegistry.selectSkin(data.name, true);                                          chromeRegistry.refreshSkins();}
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/138160d97442fc5522e23b941a556687cb58b17b/pref-themes.js/clean/browser/components/prefwindow/content/pref-themes.js