Bug 1179249 - Always use the modern settings dialog in Preferences on Windows 10. r=jaws

This commit is contained in:
Masatoshi Kimura 2015-07-03 06:39:52 +09:00
Родитель 5032fb6a13
Коммит cbfe941567
1 изменённых файлов: 2 добавлений и 28 удалений

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

@ -687,30 +687,6 @@ 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 10+, 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 10+.
// Windows 8.1 is version 6.3. The startup code still uses
// the default protocol dialog, but the preferences is more "advanced"
// and as such uses the file type associations.
let version = Services.sysinfo.getProperty("version");
claimAllTypes = (parseFloat(version) <= 6.3);
}
} catch (ex) {}
return claimAllTypes;
},
/**
* Show button for setting browser as default browser or information that
* browser is already the default browser.
@ -724,8 +700,7 @@ var gMainPane = {
return;
}
let setDefaultPane = document.getElementById("setDefaultPane");
let claimAllTypes = gMainPane.shouldClaimAllTypes();
let selectedIndex = shellSvc.isDefaultBrowser(false, claimAllTypes) ? 1 : 0;
let selectedIndex = shellSvc.isDefaultBrowser(false, true) ? 1 : 0;
setDefaultPane.selectedIndex = selectedIndex;
},
@ -738,8 +713,7 @@ var gMainPane = {
if (!shellSvc)
return;
try {
let claimAllTypes = gMainPane.shouldClaimAllTypes();
shellSvc.setDefaultBrowser(claimAllTypes, false);
shellSvc.setDefaultBrowser(true, false);
} catch (ex) {
Cu.reportError(ex);
return;