Bug 847627 (part 2) - Unify Browsing and Download history entries in shutdown Sanitize dialog.
authorMarco Bonardo <mbonardo@mozilla.com>
Wed, 20 Mar 2013 18:07:05 +0100
changeset 125654 bea32c1185e762817fadfd6395618cdc16bc6879
parent 125653 6229f99a15f0e4a0e44eaa617ee64309df8b6783
child 125655 4d5bd5014ce6531456f00fe0b351fd4350ed46ca
push id25033
push usermak77@bonardo.net
push dateWed, 20 Mar 2013 17:07:18 +0000
treeherdermozilla-inbound@bea32c1185e7 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs847627
milestone22.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 847627 (part 2) - Unify Browsing and Download history entries in shutdown Sanitize dialog. r=gavin
browser/base/content/sanitize.xul
browser/components/preferences/sanitize.js
browser/components/preferences/sanitize.xul
browser/locales/en-US/chrome/browser/sanitize.dtd
--- a/browser/base/content/sanitize.xul
+++ b/browser/base/content/sanitize.xul
@@ -21,17 +21,17 @@
   %sanitizeDTD;
 ]>
 
 <prefwindow id="SanitizeDialog" type="child"
             xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
             dlgbuttons="accept,cancel"
             title="&sanitizeDialog2.title;"
             noneverythingtitle="&sanitizeDialog2.title;"
-            style="width: &dialog.width;;"
+            style="width: &dialog.width2;;"
             ondialogaccept="gSanitizePromptDialog.sanitize();">
 
   <prefpane id="SanitizeDialogPane" onpaneload="gSanitizePromptDialog.init();">
     <stringbundle id="bundleBrowser"
                   src="chrome://browser/locale/browser.properties"/>
 
     <script type="application/javascript"
             src="chrome://browser/content/sanitize.js"/>
--- a/browser/components/preferences/sanitize.js
+++ b/browser/components/preferences/sanitize.js
@@ -1,27 +1,12 @@
 /* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-XPCOMUtils.defineLazyModuleGetter(this, "DownloadsCommon",
-                                  "resource:///modules/DownloadsCommon.jsm");
-
 let gSanitizeDialog = Object.freeze({
-  /**
-   * Sets up the UI.
-   */
-  init: function ()
-  {
-    let downloadsPref = document.getElementById("privacy.clearOnShutdown.downloads");
-    downloadsPref.disabled = !DownloadsCommon.useToolkitUI;
-    this.onClearHistoryChanged();
-  },
-
   onClearHistoryChanged: function () {
-    if (DownloadsCommon.useToolkitUI)
-      return;
     let downloadsPref = document.getElementById("privacy.clearOnShutdown.downloads");
     let historyPref = document.getElementById("privacy.clearOnShutdown.history");
     downloadsPref.value = historyPref.value;
   }
 });
--- a/browser/components/preferences/sanitize.xul
+++ b/browser/components/preferences/sanitize.xul
@@ -14,19 +14,19 @@
   %brandDTD;
   %sanitizeDTD;
 ]>
 
 <prefwindow id="SanitizeDialog" type="child"
             xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
             dlgbuttons="accept,cancel,help"
             ondialoghelp="openPrefsHelp()"
-            style="width: &dialog.width;;"
+            style="width: &dialog.width2;;"
             title="&sanitizePrefs2.title;"
-            onload="gSanitizeDialog.init();">
+            onload="gSanitizeDialog.onClearHistoryChanged();">
 
   <script type="application/javascript" src="chrome://browser/content/utilityOverlay.js"/>
   <script type="application/javascript" src="chrome://browser/content/preferences/sanitize.js"/>
 
   <prefpane id="SanitizeDialogPane"
             helpTopic="prefs-clear-private-data">
 
     <preferences>
@@ -43,52 +43,49 @@
     </preferences>
 
     <description>&clearDataSettings2.label;</description>
 
     <groupbox orient="horizontal">
       <caption label="&historySection.label;"/>
       <grid flex="1">
         <columns>
-          <column style="width: &column.width;"/>
+          <column style="width: &column.width2;"/>
           <column flex="1"/>
         </columns>
         <rows>
           <row>
-            <checkbox label="&itemBrowsingHistory.label;"
-                      accesskey="&itemBrowsingHistory.accesskey;"
+            <checkbox label="&itemHistoryAndDownloads.label;"
+                      accesskey="&itemHistoryAndDownloads.accesskey;"
                       preference="privacy.clearOnShutdown.history"/>
             <checkbox label="&itemCookies.label;"
                       accesskey="&itemCookies.accesskey;"
                       preference="privacy.clearOnShutdown.cookies"/>
           </row>
           <row>
-            <checkbox label="&itemDownloadHistory.label;"
-                      accesskey="&itemDownloadHistory.accesskey;"
-                      preference="privacy.clearOnShutdown.downloads"/>
             <checkbox label="&itemActiveLogins.label;"
                       accesskey="&itemActiveLogins.accesskey;"
                       preference="privacy.clearOnShutdown.sessions"/>
+            <checkbox label="&itemCache.label;"
+                      accesskey="&itemCache.accesskey;"
+                      preference="privacy.clearOnShutdown.cache"/>
           </row>
           <row>
             <checkbox label="&itemFormSearchHistory.label;"
                       accesskey="&itemFormSearchHistory.accesskey;"
                       preference="privacy.clearOnShutdown.formdata"/>
-            <checkbox label="&itemCache.label;"
-                      accesskey="&itemCache.accesskey;"
-                      preference="privacy.clearOnShutdown.cache"/>
           </row>
         </rows>
       </grid>
     </groupbox>
     <groupbox orient="horizontal">
       <caption label="&dataSection.label;"/>
       <grid flex="1">
         <columns>
-          <column style="width: &column.width;"/>
+          <column style="width: &column.width2;"/>
           <column flex="1"/>
         </columns>
         <rows>
           <row>
             <checkbox label="&itemPasswords.label;"
                       accesskey="&itemPasswords.accesskey;"
                       preference="privacy.clearOnShutdown.passwords"/>
             <checkbox label="&itemOfflineApps.label;"
--- a/browser/locales/en-US/chrome/browser/sanitize.dtd
+++ b/browser/locales/en-US/chrome/browser/sanitize.dtd
@@ -27,39 +27,36 @@ that require it.  -->
      of the "Details" progressive disclosure button.  See UI mockup at bug
      480169 -->
 <!ENTITY detailsProgressiveDisclosure.label     "Details">
 <!ENTITY detailsProgressiveDisclosure.accesskey "e">
 
 <!ENTITY historySection.label         "History">
 <!ENTITY dataSection.label            "Data">
 
-<!-- LOCALIZATION NOTE (item*): itemHistoryAndDownloads.* and
-     itemBrowsingHistory.* will never be used at the same time, so they can
-     have the same accesskey. -->
 <!ENTITY itemHistoryAndDownloads.label     "Browsing &amp; Download History">
 <!ENTITY itemHistoryAndDownloads.accesskey "B">
-<!ENTITY itemBrowsingHistory.label         "Browsing History">
-<!ENTITY itemBrowsingHistory.accesskey     "B">
 <!ENTITY itemFormSearchHistory.label       "Form &amp; Search History">
 <!ENTITY itemFormSearchHistory.accesskey   "F">
 <!ENTITY itemPasswords.label               "Saved Passwords">
 <!ENTITY itemPasswords.accesskey           "P">
 <!ENTITY itemCookies.label                 "Cookies">
 <!ENTITY itemCookies.accesskey             "C">
 <!ENTITY itemCache.label                   "Cache">
 <!ENTITY itemCache.accesskey               "A">
 <!ENTITY itemOfflineApps.label             "Offline Website Data">
 <!ENTITY itemOfflineApps.accesskey         "O">
-<!ENTITY itemDownloadHistory.label         "Download History">
-<!ENTITY itemDownloadHistory.accesskey     "D">
 <!ENTITY itemActiveLogins.label            "Active Logins">
 <!ENTITY itemActiveLogins.accesskey        "L">
 <!ENTITY itemSitePreferences.label         "Site Preferences">
 <!ENTITY itemSitePreferences.accesskey     "S">
 
 <!-- LOCALIZATION NOTE (sanitizeEverythingUndoWarning): Second warning paragraph
      that appears when "Time range to clear" is set to "Everything".  See UI
      mockup at bug 480169 -->
 <!ENTITY sanitizeEverythingUndoWarning     "This action cannot be undone.">
 
-<!ENTITY dialog.width                 "28em">
-<!ENTITY column.width                 "14em">
+<!-- LOCALIZATION NOTE (dialog.width2): width of the Clear Recent History and
+     Clear History on Shutdown dialogs.  Should be large enough to contain
+     the item* strings above on a single line.  The column width should be set
+     at half of the dialog width. -->
+<!ENTITY dialog.width2                 "34em">
+<!ENTITY column.width2                 "17em">