From 485af060ecc8dcf468259c83d4cbf745c7a6b646 Mon Sep 17 00:00:00 2001 From: Asaf Romano Date: Mon, 18 Aug 2014 15:02:58 +0300 Subject: [PATCH] Bug 1040868 - Move 'default browser'stuff back to the General preferences pane. r=jaws. --- browser/components/preferences/advanced.js | 82 ------------------- browser/components/preferences/advanced.xul | 30 ------- .../preferences/in-content/advanced.js | 81 ------------------ .../preferences/in-content/advanced.xul | 27 ------ .../components/preferences/in-content/main.js | 79 ++++++++++++++++++ .../preferences/in-content/main.xul | 31 +++++++ browser/components/preferences/jar.mn | 2 +- browser/components/preferences/main.js | 79 ++++++++++++++++++ browser/components/preferences/main.xul | 31 +++++++ .../chrome/browser/preferences/advanced.dtd | 7 -- .../en-US/chrome/browser/preferences/main.dtd | 8 ++ .../themes/linux/preferences/preferences.css | 5 ++ .../themes/osx/preferences/preferences.css | 6 ++ .../shared/incontentprefs/preferences.css | 4 + .../windows/preferences/preferences.css | 6 ++ 15 files changed, 250 insertions(+), 228 deletions(-) diff --git a/browser/components/preferences/advanced.js b/browser/components/preferences/advanced.js index 37dea3d5467e..2bcc0551b8ff 100644 --- a/browser/components/preferences/advanced.js +++ b/browser/components/preferences/advanced.js @@ -30,43 +30,6 @@ var gAdvancedPane = { advancedPrefs.selectedIndex = preference.value; } -#ifdef HAVE_SHELL_SERVICE - this.updateSetDefaultBrowser(); -#ifdef XP_WIN - // 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. On other Windows OS's defaults can also - // be set while the prefs are open. - window.setInterval(this.updateSetDefaultBrowser, 1000); - -#ifdef MOZ_METRO - // Pre Windows 8, we should hide the update related settings - // for the Metro browser - let version = Components.classes["@mozilla.org/system-info;1"]. - getService(Components.interfaces.nsIPropertyBag2). - getProperty("version"); - let preWin8 = parseFloat(version) < 6.2; - this._showingWin8Prefs = !preWin8; - if (preWin8) { - ["autoMetro", "autoMetroIndent"].forEach( - function(id) document.getElementById(id).collapsed = true - ); - } else { - let brandShortName = - document.getElementById("bundleBrand").getString("brandShortName"); - let bundlePrefs = document.getElementById("bundlePreferences"); - let autoDesktop = document.getElementById("autoDesktop"); - autoDesktop.label = - bundlePrefs.getFormattedString("updateAutoDesktop.label", - [brandShortName]); - autoDesktop.accessKey = - bundlePrefs.getString("updateAutoDesktop.accessKey"); - } -#endif -#endif -#endif - #ifdef MOZ_UPDATER this.updateReadPrefs(); #endif @@ -854,49 +817,4 @@ var gAdvancedPane = { "chrome://pippki/content/device_manager.xul", "", null); } -#ifdef HAVE_SHELL_SERVICE - , - - // SYSTEM DEFAULTS - - /* - * Preferences: - * - * browser.shell.checkDefault - * - true if a default-browser check (and prompt to make it so if necessary) - * occurs at startup, false otherwise - */ - - /** - * Show button for setting browser as default browser or information that - * browser is already the default browser. - */ - updateSetDefaultBrowser: function() - { - let shellSvc = getShellService(); - let setDefaultPane = document.getElementById("setDefaultPane"); - if (!shellSvc) { - setDefaultPane.hidden = true; - document.getElementById("alwaysCheckDefault").disabled = true; - return; - } - let selectedIndex = - shellSvc.isDefaultBrowser(false, true) ? 1 : 0; - setDefaultPane.selectedIndex = selectedIndex; - }, - - /** - * Set browser as the operating system default browser. - */ - setDefaultBrowser: function() - { - let shellSvc = getShellService(); - if (!shellSvc) - return; - shellSvc.setDefaultBrowser(true, false); - let selectedIndex = - shellSvc.isDefaultBrowser(false, true) ? 1 : 0; - document.getElementById("setDefaultPane").selectedIndex = selectedIndex; - } -#endif }; diff --git a/browser/components/preferences/advanced.xul b/browser/components/preferences/advanced.xul index 705fa84cb0e1..eba79d489891 100644 --- a/browser/components/preferences/advanced.xul +++ b/browser/components/preferences/advanced.xul @@ -40,16 +40,6 @@ #endif -#ifdef HAVE_SHELL_SERVICE - - - -#endif - #ifdef MOZ_TELEMETRY_REPORTING @@ -172,26 +162,6 @@ onsynctopreference="return gAdvancedPane.writeCheckSpelling();" preference="layout.spellcheckDefault"/> - -#ifdef HAVE_SHELL_SERVICE - - - - - - - -