Bug 1367350 - Add Learn More link for the "Use recommended performance settings" checkbox. draft
authorEvan Tseng <evan@tseng.io>
Wed, 24 May 2017 18:10:10 +0800
changeset 583625 e40900a598b0c6e4024cad01b4d94955bdecbef0
parent 583335 96e18bec9fc8a5ce623c16167c12756bbe190d73
child 630137 79a6d8472f138cef3e9f0b9d7cb25abb7a89132b
push id60477
push userbmo:evan@tseng.io
push dateWed, 24 May 2017 10:12:59 +0000
bugs1367350
milestone55.0a1
Bug 1367350 - Add Learn More link for the "Use recommended performance settings" checkbox. MozReview-Commit-ID: ALEuQlTphKa
browser/components/preferences/in-content-old/main.js
browser/components/preferences/in-content-old/main.xul
browser/locales/en-US/chrome/browser/preferences-old/advanced.dtd
--- a/browser/components/preferences/in-content-old/main.js
+++ b/browser/components/preferences/in-content-old/main.js
@@ -59,16 +59,20 @@ var gMainPane = {
 
     let defaultPerformancePref =
       document.getElementById("browser.preferences.defaultPerformanceSettings.enabled");
     defaultPerformancePref.addEventListener("change", () => {
       this.updatePerformanceSettingsBox();
     });
     this.updatePerformanceSettingsBox();
 
+    let performanceSettingsLink = document.getElementById("performanceSettingsLearnMore");
+    let performanceSettingsUrl = Services.urlFormatter.formatURLPref("app.support.baseURL") + "performance";
+    performanceSettingsLink.setAttribute("href", performanceSettingsUrl);
+
     // set up the "use current page" label-changing listener
     this._updateUseCurrentButton();
     window.addEventListener("focus", this._updateUseCurrentButton.bind(this));
 
     this.updateBrowserStartupLastSession();
 
     if (AppConstants.platform == "win") {
       // Functionality for "Show tabs in taskbar" on Windows 7 and up.
--- a/browser/components/preferences/in-content-old/main.xul
+++ b/browser/components/preferences/in-content-old/main.xul
@@ -317,20 +317,23 @@
               preference="browser.taskbar.previews.enable"/>
 #endif
 </groupbox>
 
 <!-- Performance -->
 <groupbox id="performanceGroup" data-category="paneGeneral" hidden="true">
   <caption><label>&performance.label;</label></caption>
 
-  <checkbox id="useRecommendedPerformanceSettings"
-            label="&useRecommendedPerformanceSettings.label;"
-            accesskey="&useRecommendedPerformanceSettings.accesskey;"
-            preference="browser.preferences.defaultPerformanceSettings.enabled"/>
+  <hbox align="center">
+    <checkbox id="useRecommendedPerformanceSettings"
+              label="&useRecommendedPerformanceSettings.label;"
+              accesskey="&useRecommendedPerformanceSettings.accesskey;"
+              preference="browser.preferences.defaultPerformanceSettings.enabled"/>
+    <label id="performanceSettingsLearnMore" class="learnMore text-link">&performanceSettingsLearnMore.label;</label>
+  </hbox>
   <description class="indent">&useRecommendedPerformanceSettings.description;</description>
 
   <vbox id="performanceSettings" class="indent" hidden="true">
     <checkbox id="allowHWAccel"
               label="&allowHWAccel.label;"
               accesskey="&allowHWAccel.accesskey;"
               preference="layers.acceleration.disabled"/>
     <hbox align="center">
--- a/browser/locales/en-US/chrome/browser/preferences-old/advanced.dtd
+++ b/browser/locales/en-US/chrome/browser/preferences-old/advanced.dtd
@@ -126,14 +126,16 @@
 
 <!ENTITY performance.label               "Performance">
 <!ENTITY useRecommendedPerformanceSettings.label
                                          "Use recommended performance settings">
 <!ENTITY useRecommendedPerformanceSettings.description
                                          "These settings are tailored to your computer’s hardware and operating system.">
 <!ENTITY useRecommendedPerformanceSettings.accesskey
                                          "U">
+<!ENTITY performanceSettingsLearnMore.label
+                                         "Learn more">
 <!ENTITY limitContentProcess.label       "Content process limit">
 <!ENTITY limitContentProcess.description
                                          "Additional content processes can improve &brandShortName; performance when using multiple tabs, but will also use more memory.">
 <!ENTITY limitContentProcess.accesskey   "L">
 <!ENTITY allowHWAccel.label              "Use hardware acceleration when available">
 <!ENTITY allowHWAccel.accesskey          "r">