Bug 531825 - Confirm before clearing private data [r=mbrubeck]
authorMark Finkle <mfinkle@mozilla.com>
Tue, 21 Dec 2010 12:42:04 -0500
changeset 67146 276098ec87b8dc0933c01ee26955e8043483c9e7
parent 67145 ebfe1108400509dda1a59ffa83fb11d0aad3e318
child 67147 6440219a17d7476a1ee7ea51968fe2eb3e949cc0
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmbrubeck
bugs531825
Bug 531825 - Confirm before clearing private data [r=mbrubeck]
mobile/chrome/content/browser-ui.js
mobile/locales/en-US/chrome/browser.properties
--- a/mobile/chrome/content/browser-ui.js
+++ b/mobile/chrome/content/browser-ui.js
@@ -1093,22 +1093,28 @@ var BrowserUI = {
       case "cmd_closeTab":
         this.closeTab();
         break;
       case "cmd_undoCloseTab":
         this.undoCloseTab();
         break;
       case "cmd_sanitize":
       {
-        // disable the button temporarily to indicate something happened
-        let button = document.getElementById("prefs-clear-data");
-        button.disabled = true;
-        setTimeout(function() { button.disabled = false; }, 5000);
-
-        Sanitizer.sanitize();
+        let strings = Elements.browserBundle;
+        let title = strings.getString("clearPrivateData.title");
+        let message = strings.getString("clearPrivateData.message");
+        let clear = Services.prompt.confirm(window, title, message);
+        if (clear) {
+          // disable the button temporarily to indicate something happened
+          let button = document.getElementById("prefs-clear-data");
+          button.disabled = true;
+          setTimeout(function() { button.disabled = false; }, 5000);
+
+          Sanitizer.sanitize();
+        }
         break;
       }
       case "cmd_panel":
       {
         if (BrowserUI.isPanelVisible())
           this.hidePanel();
         else
           this.showPanel();
--- a/mobile/locales/en-US/chrome/browser.properties
+++ b/mobile/locales/en-US/chrome/browser.properties
@@ -200,8 +200,12 @@ pageactions.password=Password
 opensearch.searchWith=Search With:
 opensearch.searchFor=Search for "%S"
 
 # Open in Another App
 # LOCALIZATION NOTE: openinapp.specific is the text displayed if there is a single external app
 # %S is the name of the app, like "YouTube" or "Picassa"
 openinapp.specific=Open in %S App
 openinapp.general=Open in Another App
+
+# Clear Private Data
+clearPrivateData.title=Clear Private Data
+clearPrivateData.message=Delete your browsing history and settings, including passwords and cookies?