Bug 1223371 - hide Windows search option from Thunderbird System integration dialog startup prompt. r=jorgk a=jorgk
authoraceman <acelists@atlas.sk>
Thu, 21 Jul 2016 22:26:00 +0200
changeset 27500 e694081295e389f28a11cde94c4d4a1cc69050c9
parent 27499 15bae09243e012a9fda19d943d3ba7c1b56b7e0b
child 27501 d0ba64c989ce619519be5f034a2d83f991eb6a4c
push id1850
push userclokep@gmail.com
push dateWed, 08 Mar 2017 19:29:12 +0000
treeherdercomm-esr52@028df196b2d9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjorgk, jorgk
bugs1223371
Bug 1223371 - hide Windows search option from Thunderbird System integration dialog startup prompt. r=jorgk a=jorgk
mail/base/content/systemIntegrationDialog.js
--- a/mail/base/content/systemIntegrationDialog.js
+++ b/mail/base/content/systemIntegrationDialog.js
@@ -32,17 +32,20 @@ var gSystemIntegrationDialog = {
     this._rssCheckbox     = document.getElementById("checkRSS");
     this._startupCheckbox = document.getElementById("checkOnStartup");
     this._searchCheckbox  = document.getElementById("searchIntegration");
 
     // Initialize the check boxes based on the default app states.
     this._mailCheckbox.disabled =
       this._shellSvc.isDefaultClient(false, this._shellSvc.MAIL);
 
-    if (!("arguments" in window) || (window.arguments[0] != "calledFromPrefs")) {
+    let calledFromPrefs = ("arguments" in window) &&
+                          (window.arguments[0] == "calledFromPrefs");
+
+    if (!calledFromPrefs) {
       // As an optimization, if we aren't already the default mail client,
       // then pre-check that option for the user. We'll leave News and RSS alone.
       // Do this only if we are not called from the Preferences (Options) dialog.
       // In that case, the user may want to just check what the current state is.
       this._mailCheckbox.checked = true;
     } else {
       this._mailCheckbox.checked = this._mailCheckbox.disabled;
 
@@ -68,22 +71,28 @@ var gSystemIntegrationDialog = {
     // read the raw pref value and not shellSvc.shouldCheckDefaultMail
     this._startupCheckbox.checked =
       this.Services.prefs.getBoolPref("mail.shell.checkDefaultClient");
 
     // Search integration - check whether we should show/disable integration options
     if (this.SearchIntegration)
     {
       this._searchCheckbox.checked = this.SearchIntegration.prefEnabled;
-      if (!this.SearchIntegration.osVersionTooLow) {
-        this._searchCheckbox.hidden = false;
-        if (this.SearchIntegration.osComponentsNotRunning)
-        {
-          this._searchCheckbox.checked = false;
-          this._searchCheckbox.disabled = true;
+      // On Windows, do not offer the option on startup as it does not perform well.
+      if ((Services.appinfo.OS == "WINNT") && !calledFromPrefs &&
+          !this._searchCheckbox.checked) {
+        this._searchCheckbox.hidden = true;
+      } else {
+        // Hide/disable the options if the OS does not support them.
+        if (!this.SearchIntegration.osVersionTooLow) {
+          this._searchCheckbox.hidden = false;
+          if (this.SearchIntegration.osComponentsNotRunning) {
+            this._searchCheckbox.checked = false;
+            this._searchCheckbox.disabled = true;
+          }
         }
       }
     }
   },
 
   /**
    * Called when the dialog is closed by any button.
    *