Bug 1349155 - Show message when clearing user data on shutdown. r?sebastian draft
authorJan Henning <jh+bugzilla@buttercookie.de>
Sun, 26 Mar 2017 18:41:09 +0200
changeset 579741 d0e945446281e1ab43c26b7c2965660969248fd9
parent 579740 c835274239ec77f3c85345775f5491abaea85bb1
child 629106 417cf318cd74645ae8edc6641ac33a03a2c19ad5
push id59358
push usermozilla@buttercookie.de
push dateWed, 17 May 2017 19:08:01 +0000
reviewerssebastian
bugs1349155
milestone55.0a1
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
mobile/android/chrome/content/browser.js
mobile/android/locales/en-US/chrome/browser.properties
--- 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