From a818212fb8a31d04ddbfdea5227c9bdc0c71d2d2 Mon Sep 17 00:00:00 2001 From: Edouard Oger Date: Fri, 17 Jul 2015 13:18:00 -0400 Subject: [PATCH] Bug 1102184 - Deprecate the clear saved passwords on shutdown feature. r=dolske --- browser/app/profile/firefox.js | 4 +-- browser/base/content/sanitize.js | 34 ++++++++----------- .../tests/unit/test_clearHistory_shutdown.js | 1 - browser/components/preferences/sanitize.xul | 12 ++----- .../locales/en-US/chrome/browser/sanitize.dtd | 2 -- toolkit/components/telemetry/Histograms.json | 9 ----- 6 files changed, 19 insertions(+), 43 deletions(-) diff --git a/browser/app/profile/firefox.js b/browser/app/profile/firefox.js index d5ae31aa80cf..af202b834d5a 100644 --- a/browser/app/profile/firefox.js +++ b/browser/app/profile/firefox.js @@ -541,7 +541,6 @@ pref("privacy.item.cookies", false); pref("privacy.clearOnShutdown.history", true); pref("privacy.clearOnShutdown.formdata", true); -pref("privacy.clearOnShutdown.passwords", false); pref("privacy.clearOnShutdown.downloads", true); pref("privacy.clearOnShutdown.cookies", true); pref("privacy.clearOnShutdown.cache", true); @@ -574,6 +573,8 @@ pref("privacy.sanitize.sanitizeOnShutdown", false); pref("privacy.sanitize.migrateFx3Prefs", false); +pref("privacy.sanitize.migrateClearSavedPwdsOnExit", false); + pref("privacy.panicButton.enabled", true); pref("network.proxy.share_proxy_settings", false); // use the same proxy settings for all protocols @@ -1344,7 +1345,6 @@ pref("services.sync.prefs.sync.privacy.clearOnShutdown.downloads", true); pref("services.sync.prefs.sync.privacy.clearOnShutdown.formdata", true); pref("services.sync.prefs.sync.privacy.clearOnShutdown.history", true); pref("services.sync.prefs.sync.privacy.clearOnShutdown.offlineApps", true); -pref("services.sync.prefs.sync.privacy.clearOnShutdown.passwords", true); pref("services.sync.prefs.sync.privacy.clearOnShutdown.sessions", true); pref("services.sync.prefs.sync.privacy.clearOnShutdown.siteSettings", true); pref("services.sync.prefs.sync.privacy.donottrackheader.enabled", true); diff --git a/browser/base/content/sanitize.js b/browser/base/content/sanitize.js index bc602d687b76..a657a9c058f4 100644 --- a/browser/base/content/sanitize.js +++ b/browser/base/content/sanitize.js @@ -447,26 +447,6 @@ Sanitizer.prototype = { } }, - passwords: { - clear: function () - { - TelemetryStopwatch.start("FX_SANITIZE_PASSWORDS"); - var pwmgr = Components.classes["@mozilla.org/login-manager;1"] - .getService(Components.interfaces.nsILoginManager); - // Passwords are timeless, and don't respect the timeSpan setting - pwmgr.removeAllLogins(); - TelemetryStopwatch.finish("FX_SANITIZE_PASSWORDS"); - }, - - get canClear() - { - var pwmgr = Components.classes["@mozilla.org/login-manager;1"] - .getService(Components.interfaces.nsILoginManager); - var count = pwmgr.countLogins("", "", ""); // count all logins - return (count > 0); - } - }, - sessions: { clear: function () { @@ -785,6 +765,20 @@ Sanitizer._checkAndSanitize = function() const prefs = Sanitizer.prefs; if (prefs.getBoolPref(Sanitizer.prefShutdown) && !prefs.prefHasUserValue(Sanitizer.prefDidShutdown)) { + + // One time migration to remove support for the clear saved passwords on exit feature. + if (!Services.prefs.getBoolPref("privacy.sanitize.migrateClearSavedPwdsOnExit")) { + let deprecatedPref = "privacy.clearOnShutdown.passwords"; + let doUpdate = Services.prefs.prefHasUserValue(deprecatedPref) && + Services.prefs.getBoolPref(deprecatedPref); + if (doUpdate) { + Services.logins.removeAllLogins(); + Services.prefs.setBoolPref("signon.rememberSignons", false); + } + Services.prefs.clearUserPref(deprecatedPref); + Services.prefs.setBoolPref("privacy.sanitize.migrateClearSavedPwdsOnExit", true); + } + // this is a shutdown or a startup after an unclean exit var s = new Sanitizer(); s.prefDomain = "privacy.clearOnShutdown."; diff --git a/browser/components/places/tests/unit/test_clearHistory_shutdown.js b/browser/components/places/tests/unit/test_clearHistory_shutdown.js index ecbfc90979dd..a20f124549b5 100644 --- a/browser/components/places/tests/unit/test_clearHistory_shutdown.js +++ b/browser/components/places/tests/unit/test_clearHistory_shutdown.js @@ -57,7 +57,6 @@ add_task(function* test_execute() { Services.prefs.setBoolPref("privacy.clearOnShutdown.downloads", true); Services.prefs.setBoolPref("privacy.clearOnShutdown.cookies", true); Services.prefs.setBoolPref("privacy.clearOnShutdown.formData", true); - Services.prefs.setBoolPref("privacy.clearOnShutdown.passwords", true); Services.prefs.setBoolPref("privacy.clearOnShutdown.sessions", true); Services.prefs.setBoolPref("privacy.clearOnShutdown.siteSettings", true); diff --git a/browser/components/preferences/sanitize.xul b/browser/components/preferences/sanitize.xul index 6e31f72834d8..ca020ba44e7d 100644 --- a/browser/components/preferences/sanitize.xul +++ b/browser/components/preferences/sanitize.xul @@ -34,7 +34,6 @@ - @@ -87,18 +86,13 @@ - - - - + diff --git a/browser/locales/en-US/chrome/browser/sanitize.dtd b/browser/locales/en-US/chrome/browser/sanitize.dtd index 7e082fa12c6f..ab06ece0e90c 100644 --- a/browser/locales/en-US/chrome/browser/sanitize.dtd +++ b/browser/locales/en-US/chrome/browser/sanitize.dtd @@ -52,8 +52,6 @@ that require it. --> - - diff --git a/toolkit/components/telemetry/Histograms.json b/toolkit/components/telemetry/Histograms.json index d10f90784e93..be50a5333369 100644 --- a/toolkit/components/telemetry/Histograms.json +++ b/toolkit/components/telemetry/Histograms.json @@ -8135,15 +8135,6 @@ "extended_statistics_ok": true, "description": "Sanitize: Time it takes to sanitize recent downloads (ms)" }, - "FX_SANITIZE_PASSWORDS": { - "alert_emails": ["firefox-dev@mozilla.org", "gavin@mozilla.com"], - "expires_in_version": "50", - "kind": "exponential", - "high": "30000", - "n_buckets": 20, - "extended_statistics_ok": true, - "description": "Sanitize: Time it takes to sanitize saved passwords (ms)" - }, "FX_SANITIZE_SESSIONS": { "alert_emails": ["firefox-dev@mozilla.org", "gavin@mozilla.com"], "expires_in_version": "50",