Bug 1436568 - Make "clear your recent history" a button instead of a link. r=nhnt11
authorJohann Hofmann <jhofmann@mozilla.com>
Mon, 19 Feb 2018 23:02:33 +0100
changeset 759114 ce6adae0faa1a40db9e0015d880c3d086f755d23
parent 759113 36be9b83bcc9928cd06ebdd3402939e152582fff
child 759115 bd876f6cfc077e29607949c1d06bfceca0fcee03
push id100272
push userrwood@mozilla.com
push dateFri, 23 Feb 2018 18:27:33 +0000
reviewersnhnt11
bugs1436568
milestone60.0a1
Bug 1436568 - Make "clear your recent history" a button instead of a link. r=nhnt11 MozReview-Commit-ID: 1KDXu9OtmHm
browser/components/preferences/in-content/privacy.js
browser/components/preferences/in-content/privacy.xul
browser/locales/en-US/chrome/browser/preferences/privacy.dtd
browser/tools/mozscreenshots/mozscreenshots/extension/configurations/Preferences.jsm
--- a/browser/components/preferences/in-content/privacy.js
+++ b/browser/components/preferences/in-content/privacy.js
@@ -263,27 +263,21 @@ var gPrivacyPane = {
     Preferences.get("privacy.trackingprotection.pbmode.enabled").on("change",
       gPrivacyPane.trackingProtectionReadPrefs.bind(gPrivacyPane));
     setEventListener("historyMode", "command", function() {
       gPrivacyPane.updateHistoryModePane();
       gPrivacyPane.updateHistoryModePrefs();
       gPrivacyPane.updatePrivacyMicroControls();
       gPrivacyPane.updateAutostart();
     });
-    setEventListener("historyRememberClear", "click", function(event) {
-      if (event.button == 0) {
-        gPrivacyPane.clearPrivateDataNow(false);
-      }
-      return false;
-    });
-    setEventListener("historyDontRememberClear", "click", function(event) {
-      if (event.button == 0) {
-        gPrivacyPane.clearPrivateDataNow(true);
-      }
-      return false;
+    setEventListener("clearHistoryButton", "command", function() {
+      let historyMode = document.getElementById("historyMode");
+      // Select "everything" in the clear history dialog if the
+      // user has set their history mode to never remember history.
+      gPrivacyPane.clearPrivateDataNow(historyMode.value == "dontremember");
     });
     setEventListener("openSearchEnginePreferences", "click", function(event) {
       if (event.button == 0) {
         gotoPref("search");
       }
       return false;
     });
     setEventListener("privateBrowsingAutoStart", "command",
--- a/browser/components/preferences/in-content/privacy.xul
+++ b/browser/components/preferences/in-content/privacy.xul
@@ -70,24 +70,18 @@
     <label id="historyModeLabel"
            control="historyMode"
            accesskey="&historyHeader2.pre.accesskey;">&historyHeader2.pre.label;
     </label>
     <!-- Please don't remove the wrapping hbox/vbox/box for these elements. It's used to properly compute the search tooltip position. -->
     <hbox>
       <menulist id="historyMode">
         <menupopup>
-          <menuitem label="&historyHeader.remember.label;" value="remember" searchkeywords="&rememberDescription.label;
-                                                                                            &dontrememberActions.pre.label;
-                                                                                            &dontrememberActions.clearHistory.label;
-                                                                                            &dontrememberActions.post.label;"/>
-          <menuitem label="&historyHeader.dontremember.label;" value="dontremember" searchkeywords="&dontrememberDescription.label;
-                                                                                                    &dontrememberActions.pre.label;
-                                                                                                    &dontrememberActions.clearHistory.label;
-                                                                                                    &dontrememberActions.post.label;"/>
+          <menuitem label="&historyHeader.remember.label;" value="remember" searchkeywords="&rememberDescription.label;"/>
+          <menuitem label="&historyHeader.dontremember.label;" value="dontremember" searchkeywords="&dontrememberDescription.label;"/>
           <menuitem label="&historyHeader.custom.label;" value="custom" searchkeywords="&privateBrowsingPermanent2.label;
                                                                                         &rememberHistory2.label;
                                                                                         &rememberSearchForm.label;
                                                                                         &acceptCookies3.label;
                                                                                         &cookieExceptions.label;
                                                                                         &acceptThirdParty3.pre.label;
                                                                                         &acceptThirdParty.always.label;
                                                                                         &acceptThirdParty.visited.label;
@@ -97,81 +91,84 @@
                                                                                         &close.label;
                                                                                         &clearOnClose.label;
                                                                                         &clearOnCloseSettings.label;"/>
         </menupopup>
       </menulist>
     </hbox>
     <label>&historyHeader.post.label;</label>
   </hbox>
-  <deck id="historyPane">
-    <vbox id="historyRememberPane">
-      <hbox align="center" flex="1">
-        <vbox flex="1">
-          <description>&rememberDescription.label;</description>
-          <description>&dontrememberActions.pre.label;<label
-          class="text-link" id="historyRememberClear"
-          >&dontrememberActions.clearHistory.label;</label>&dontrememberActions.post.label;</description>
-        </vbox>
-      </hbox>
-    </vbox>
-    <vbox id="historyDontRememberPane">
-      <hbox align="center" flex="1">
-        <vbox flex="1">
-          <description>&dontrememberDescription.label;</description>
-          <description>&dontrememberActions.pre.label;<label
-          class="text-link" id="historyDontRememberClear"
-          >&dontrememberActions.clearHistory.label;</label>&dontrememberActions.post.label;</description>
-        </vbox>
-      </hbox>
-    </vbox>
-    <vbox id="historyCustomPane">
-      <vbox>
-        <checkbox id="privateBrowsingAutoStart"
-                  label="&privateBrowsingPermanent2.label;"
-                  accesskey="&privateBrowsingPermanent2.accesskey;"
-                  preference="browser.privatebrowsing.autostart"/>
-        <vbox class="indent">
-          <checkbox id="rememberHistory"
-                    label="&rememberHistory2.label;"
-                    accesskey="&rememberHistory2.accesskey;"
-                    preference="places.history.enabled"/>
-          <checkbox id="rememberForms"
-                    label="&rememberSearchForm.label;"
-                    accesskey="&rememberSearchForm.accesskey;"
-                    preference="browser.formfill.enable"/>
-          <hbox id="clearDataBox"
-                align="center">
-            <checkbox id="alwaysClear"
-                      preference="privacy.sanitize.sanitizeOnShutdown"
-                      label="&clearOnClose.label;"
-                      accesskey="&clearOnClose.accesskey;"
-                      flex="1" />
-            <!-- Please don't remove the wrapping hbox/vbox/box for these elements. It's used to properly compute the search tooltip position. -->
-            <hbox>
-              <button id="clearDataSettings"
-                      class="accessory-button"
-                      label="&clearOnCloseSettings.label;"
-                      accesskey="&clearOnCloseSettings.accesskey;"
-                      searchkeywords="&clearDataSettings3.label;
-                                      &historySection.label;
-                                      &itemHistoryAndDownloads.label;
-                                      &itemCookies.label;
-                                      &itemActiveLogins.label;
-                                      &itemCache.label;
-                                      &itemFormSearchHistory.label;
-                                      &dataSection.label;
-                                      &itemSitePreferences.label;
-                                      &itemOfflineApps.label;"/>
+  <hbox>
+    <deck id="historyPane" flex="1">
+      <vbox id="historyRememberPane">
+        <hbox align="center" flex="1">
+          <vbox flex="1">
+            <description>&rememberDescription.label;</description>
+          </vbox>
+        </hbox>
+      </vbox>
+      <vbox id="historyDontRememberPane">
+        <hbox align="center" flex="1">
+          <vbox flex="1">
+            <description>&dontrememberDescription.label;</description>
+          </vbox>
+        </hbox>
+      </vbox>
+      <vbox id="historyCustomPane">
+        <vbox>
+          <checkbox id="privateBrowsingAutoStart"
+                    label="&privateBrowsingPermanent2.label;"
+                    accesskey="&privateBrowsingPermanent2.accesskey;"
+                    preference="browser.privatebrowsing.autostart"/>
+          <vbox class="indent">
+            <checkbox id="rememberHistory"
+                      label="&rememberHistory2.label;"
+                      accesskey="&rememberHistory2.accesskey;"
+                      preference="places.history.enabled"/>
+            <checkbox id="rememberForms"
+                      label="&rememberSearchForm.label;"
+                      accesskey="&rememberSearchForm.accesskey;"
+                      preference="browser.formfill.enable"/>
+            <hbox id="clearDataBox"
+                  align="center">
+              <checkbox id="alwaysClear"
+                        preference="privacy.sanitize.sanitizeOnShutdown"
+                        label="&clearOnClose.label;"
+                        accesskey="&clearOnClose.accesskey;"
+                        flex="1" />
+              <!-- Please don't remove the wrapping hbox/vbox/box for these elements. It's used to properly compute the search tooltip position. -->
+              <hbox>
+                <button id="clearDataSettings"
+                        class="accessory-button"
+                        label="&clearOnCloseSettings.label;"
+                        accesskey="&clearOnCloseSettings.accesskey;"
+                        searchkeywords="&clearDataSettings3.label;
+                                        &historySection.label;
+                                        &itemHistoryAndDownloads.label;
+                                        &itemCookies.label;
+                                        &itemActiveLogins.label;
+                                        &itemCache.label;
+                                        &itemFormSearchHistory.label;
+                                        &dataSection.label;
+                                        &itemSitePreferences.label;
+                                        &itemOfflineApps.label;"/>
+              </hbox>
             </hbox>
-          </hbox>
+          </vbox>
         </vbox>
       </vbox>
+    </deck>
+    <vbox align="end">
+      <button id="clearHistoryButton"
+              class="accessory-button"
+              icon="clear"
+              label="&clearHistoryButton.label;"
+              accesskey="&clearHistoryButton.accesskey;"/>
     </vbox>
-  </deck>
+  </hbox>
 </groupbox>
 
 <!-- Site Data -->
 <groupbox id="siteDataGroup" hidden="true" data-category="panePrivacy" data-hidden-from-search="true">
   <caption><label>&siteData1.label;</label></caption>
 
   <hbox align="baseline">
     <vbox flex="1">
--- a/browser/locales/en-US/chrome/browser/preferences/privacy.dtd
+++ b/browser/locales/en-US/chrome/browser/preferences/privacy.dtd
@@ -65,21 +65,18 @@
 <!ENTITY  historyHeader.dontremember.label "Never remember history">
 <!ENTITY  historyHeader.custom.label       "Use custom settings for history">
 <!ENTITY  historyHeader.post.label         "">
 
 <!ENTITY  rememberDescription.label      "&brandShortName; will remember your browsing, download, form and search history, and keep cookies from websites you visit.">
 
 <!ENTITY  dontrememberDescription.label  "&brandShortName; will use the same settings as private browsing, and will not remember any history as you browse the Web.">
 
-<!-- LOCALIZATION NOTE (dontrememberActions.pre.label): include a trailing space as needed -->
-<!-- LOCALIZATION NOTE (dontrememberActions.post.label): include a starting space as needed -->
-<!ENTITY  dontrememberActions.pre.label          "You may also want to ">
-<!ENTITY  dontrememberActions.clearHistory.label "clear all current history">
-<!ENTITY  dontrememberActions.post.label         ".">
+<!ENTITY  clearHistoryButton.label       "Clear History…">
+<!ENTITY  clearHistoryButton.accesskey   "s">
 
 <!ENTITY  privateBrowsingPermanent2.label "Always use private browsing mode">
 <!ENTITY  privateBrowsingPermanent2.accesskey "p">
 
 <!ENTITY  rememberHistory2.label      "Remember my browsing and download history">
 <!ENTITY  rememberHistory2.accesskey  "b">
 
 <!ENTITY  rememberSearchForm.label       "Remember search and form history">
--- a/browser/tools/mozscreenshots/mozscreenshots/extension/configurations/Preferences.jsm
+++ b/browser/tools/mozscreenshots/mozscreenshots/extension/configurations/Preferences.jsm
@@ -120,17 +120,17 @@ async function DNTDialog(aBrowser) {
 async function connectionDialog(aBrowser) {
   await ContentTask.spawn(aBrowser, null, async function() {
     content.document.getElementById("connectionSettings").click();
   });
 }
 
 async function clearRecentHistoryDialog(aBrowser) {
   await ContentTask.spawn(aBrowser, null, async function() {
-    content.document.getElementById("historyRememberClear").click();
+    content.document.getElementById("clearHistoryButton").click();
   });
 }
 
 async function certManager(aBrowser) {
   await ContentTask.spawn(aBrowser, null, async function() {
     content.document.getElementById("viewCertificatesButton").click();
   });
 }