Bug 1349155 - Show message when clearing user data on shutdown. r?sebastian
Properly clearing data (history etc.) when shutting down via "Quit" can introduce a possibly noticeable delay (up to the order of a few seconds in bad cases) before the UI actually closes. This patch shows a snackbar for this case, so we don't give users the impression of simply randomly hanging during shutdown.
MozReview-Commit-ID: AqYw8qK8xol
--- a/mobile/android/chrome/content/browser.js
+++ b/mobile/android/chrome/content/browser.js
@@ -1505,16 +1505,21 @@ var BrowserApp = {
return this.PREF_TRACKING_PROTECTION_DISABLED;
},
sanitize: function (aItems, callback, aShutdown) {
let success = true;
var promises = [];
let refObj = {};
+ if (aShutdown && Object.getOwnPropertyNames(aItems).length > 0) {
+ let msg = Strings.browser.GetStringFromName("alertShutdownSanitize");
+ Snackbars.show(msg, Snackbars.LENGTH_INDEFINITE);
+ }
+
TelemetryStopwatch.start("FX_SANITIZE_TOTAL", refObj);
for (let key in aItems) {
if (!aItems[key])
continue;
key = key.replace("private.data.", "");
--- a/mobile/android/locales/en-US/chrome/browser.properties
+++ b/mobile/android/locales/en-US/chrome/browser.properties
@@ -34,16 +34,20 @@ downloads.disabledInGuest=Downloads are
# LOCALIZATION NOTE (alertSearchEngineAddedToast, alertSearchEngineErrorToast, alertSearchEngineDuplicateToast)
# %S will be replaced by the name of the search engine (exposed by the current page)
# that has been added; for example, 'Google'.
alertSearchEngineAddedToast='%S' has been added as a search engine
alertSearchEngineErrorToast=Couldn't add '%S' as a search engine
alertSearchEngineDuplicateToast='%S' is already one of your search engines
+# LOCALIZATION NOTE (alertShutdownSanitize): This text is shown as a snackbar during shutdown if the
+# user has enabled "Clear private data on exit".
+alertShutdownSanitize=Clearing private data…
+
alertPrintjobToast=Printing…
downloadCancelPromptTitle1=Abort Download
downloadCancelPromptMessage1=Do you want to abort this download?
addonError.titleError=Error
addonError.titleBlocked=Blocked add-on
addonError.learnMore=Learn more