Bug 1170803 - Only check for all filetype associations in Windows versions preceding 8.0 to match the startup behavior. r=Gijs

--HG--
extra : rebase_source : 9c0d0b307910ee5df87b061b8029268405301acf
This commit is contained in:
Jared Wein 2015-06-03 11:41:19 -04:00
Родитель f3d985358c
Коммит 1145c40482
1 изменённых файлов: 25 добавлений и 10 удалений

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

@ -687,6 +687,28 @@ var gMainPane = {
* occurs at startup, false otherwise
*/
/**
* Firefox can attempt to set itself as the default application
* for all related filetypes or just for HTML. Some platforms
* such as Windows have terrible UIs for all filetypes. In those
* platforms, Firefox only attempts to associate itself with HTML.
*/
shouldClaimAllTypes: function()
{
let claimAllTypes = true;
try {
if (AppConstants.platform == "win") {
// In Windows 8+, the UI for selecting default protocol is much
// nicer than the UI for setting file type associations. So we
// only show the protocol association screen on Windows 8+.
// Windows 8 is version 6.2.
let version = Services.sysinfo.getProperty("version");
claimAllTypes = (parseFloat(version) < 6.2);
}
} catch (ex) {}
return claimAllTypes;
},
/**
* Show button for setting browser as default browser or information that
* browser is already the default browser.
@ -700,7 +722,8 @@ var gMainPane = {
return;
}
let setDefaultPane = document.getElementById("setDefaultPane");
let selectedIndex = shellSvc.isDefaultBrowser(false, true) ? 1 : 0;
let claimAllTypes = gMainPane.shouldClaimAllTypes();
let selectedIndex = shellSvc.isDefaultBrowser(false, claimAllTypes) ? 1 : 0;
setDefaultPane.selectedIndex = selectedIndex;
},
@ -713,15 +736,7 @@ var gMainPane = {
if (!shellSvc)
return;
try {
let claimAllTypes = true;
if (AppConstants.platform == "win") {
// In Windows 8+, the UI for selecting default protocol is much
// nicer than the UI for setting file type associations. So we
// only show the protocol association screen on Windows 8+.
// Windows 8 is version 6.2.
let version = Services.sysinfo.getProperty("version");
claimAllTypes = (parseFloat(version) < 6.2);
}
let claimAllTypes = gMainPane.shouldClaimAllTypes();
shellSvc.setDefaultBrowser(claimAllTypes, false);
} catch (ex) {
Cu.reportError(ex);