Bug 798166 - Fix for defaults display problem after setting default depending on helper.exe speed. r=felipe

This commit is contained in:
Brian R. Bondy 2012-10-05 10:17:24 -04:00
parent 75431f5cd4
commit 3e1d9a3925
2 changed files with 6 additions and 30 deletions

View File

@ -31,24 +31,12 @@ var gAdvancedPane = {
#ifdef HAVE_SHELL_SERVICE
this.updateSetDefaultBrowser();
#ifdef XP_WIN
let shellSvc = getShellService();
// In Windows 8 we launch the control panel since it's the only
// way to get all file type association prefs. So we don't know
// when the user will select the default. We refresh here periodically
// in case the default changes.
if (!shellSvc.isDefaultBrowser(false, true)) {
var isWin8OrHigher = false;
try {
let version = Components.classes["@mozilla.org/system-info;1"].
getService(Components.interfaces.nsIPropertyBag2).
getProperty("version");
isWin8OrHigher = parseFloat(version) >= 6.2;
} catch (ex) { }
if (isWin8OrHigher) {
window.setInterval(this.updateSetDefaultBrowser, 1000);
}
}
// in case the default changes. On other Windows OS's defaults can also
// be set while the prefs are open.
window.setInterval(this.updateSetDefaultBrowser, 1000);
#endif
#endif

View File

@ -23,24 +23,12 @@ var gAdvancedPane = {
#ifdef HAVE_SHELL_SERVICE
this.updateSetDefaultBrowser();
#ifdef XP_WIN
let shellSvc = getShellService();
// In Windows 8 we launch the control panel since it's the only
// way to get all file type association prefs. So we don't know
// when the user will select the default. We refresh here periodically
// in case the default changes.
if (!shellSvc.isDefaultBrowser(false, true)) {
var isWin8OrHigher = false;
try {
let version = Components.classes["@mozilla.org/system-info;1"].
getService(Components.interfaces.nsIPropertyBag2).
getProperty("version");
isWin8OrHigher = parseFloat(version) >= 6.2;
} catch (ex) { }
if (isWin8OrHigher) {
window.setInterval(this.updateSetDefaultBrowser, 1000);
}
}
// in case the default changes. On other Windows OS's defaults can also
// be set while the prefs are open.
window.setInterval(this.updateSetDefaultBrowser, 1000);
#endif
#endif
#ifdef MOZ_UPDATER