Bug 1418131: Part 2 - Add security software section to about:support; r=jimm
authorAaron Klotz <aklotz@mozilla.com>
Sat, 18 Nov 2017 13:59:45 -0700
changeset 453692 e825d7b57a4fefd1db175757b50ce76e5f48fc13
parent 453691 fcad66c3d2e2e1443c9fd1c59423f40cc77acdff
child 453693 d47ec9fc25863d3fa7102ea3e48c5e5398e49bb6
push id1648
push usermtabara@mozilla.com
push dateThu, 01 Mar 2018 12:45:47 +0000
treeherdermozilla-release@cbb9688c2eeb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjimm
bugs1418131
milestone59.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 1418131: Part 2 - Add security software section to about:support; r=jimm MozReview-Commit-ID: 2hJkpPxFakp
toolkit/content/aboutSupport.js
toolkit/content/aboutSupport.xhtml
toolkit/locales/en-US/chrome/global/aboutSupport.dtd
toolkit/modules/Troubleshoot.jsm
toolkit/modules/tests/browser/browser_Troubleshoot.js
--- a/toolkit/content/aboutSupport.js
+++ b/toolkit/content/aboutSupport.js
@@ -178,16 +178,28 @@ var snapshotFormatters = {
         $.new("td", extension.name),
         $.new("td", extension.version),
         $.new("td", extension.isActive),
         $.new("td", extension.id),
       ]);
     }));
   },
 
+  securitySoftware: function securitySoftware(data) {
+    if (!AppConstants.isPlatformAndVersionAtLeast("win", "6.2")) {
+      $("security-software-title").hidden = true;
+      $("security-software-table").hidden = true;
+      return;
+    }
+
+    $("security-software-antivirus").textContent = data.registeredAntiVirus;
+    $("security-software-antispyware").textContent = data.registeredAntiSpyware;
+    $("security-software-firewall").textContent = data.registeredFirewall;
+  },
+
   features: function features(data) {
     $.append($("features-tbody"), data.map(function(feature) {
       return $.new("tr", [
         $.new("td", feature.name),
         $.new("td", feature.version),
         $.new("td", feature.id),
       ]);
     }));
--- a/toolkit/content/aboutSupport.xhtml
+++ b/toolkit/content/aboutSupport.xhtml
@@ -365,16 +365,63 @@
           </tr>
         </thead>
         <tbody id="extensions-tbody">
         </tbody>
       </table>
 
       <!-- - - - - - - - - - - - - - - - - - - - - -->
 
+      <h2 class="major-section" id="security-software-title">
+        &aboutSupport.securitySoftwareTitle;
+      </h2>
+
+      <table id="security-software-table">
+        <thead>
+          <tr>
+            <th>
+              &aboutSupport.securitySoftwareType;
+            </th>
+            <th>
+              &aboutSupport.securitySoftwareName;
+            </th>
+          </tr>
+        </thead>
+        <tbody>
+          <tr>
+            <th class="column">
+              &aboutSupport.securitySoftwareAntivirus;
+            </th>
+
+            <td id="security-software-antivirus">
+            </td>
+          </tr>
+
+          <tr>
+            <th class="column">
+              &aboutSupport.securitySoftwareAntiSpyware;
+            </th>
+
+            <td id="security-software-antispyware">
+            </td>
+          </tr>
+
+          <tr>
+            <th class="column">
+              &aboutSupport.securitySoftwareFirewall;
+            </th>
+
+            <td id="security-software-firewall">
+            </td>
+          </tr>
+        </tbody>
+      </table>
+
+      <!-- - - - - - - - - - - - - - - - - - - - - -->
+
       <h2 class="major-section">
         &aboutSupport.graphicsTitle;
       </h2>
 
       <table>
         <tbody id="graphics-features-tbody">
           <tr>
             <th colspan="2" class="title-column">
--- a/toolkit/locales/en-US/chrome/global/aboutSupport.dtd
+++ b/toolkit/locales/en-US/chrome/global/aboutSupport.dtd
@@ -20,16 +20,23 @@ This is likely the same like id.heading 
 <!ENTITY aboutSupport.crashes.noConfig "This application has not been configured to display crash reports.">
 
 <!ENTITY aboutSupport.extensionsTitle "Extensions">
 <!ENTITY aboutSupport.extensionName "Name">
 <!ENTITY aboutSupport.extensionEnabled "Enabled">
 <!ENTITY aboutSupport.extensionVersion "Version">
 <!ENTITY aboutSupport.extensionId "ID">
 
+<!ENTITY aboutSupport.securitySoftwareTitle "Security Software">
+<!ENTITY aboutSupport.securitySoftwareType "Type">
+<!ENTITY aboutSupport.securitySoftwareName "Name">
+<!ENTITY aboutSupport.securitySoftwareAntivirus "Antivirus">
+<!ENTITY aboutSupport.securitySoftwareAntiSpyware "Antispyware">
+<!ENTITY aboutSupport.securitySoftwareFirewall "Firewall">
+
 <!ENTITY aboutSupport.featuresTitle "&brandShortName; Features">
 <!ENTITY aboutSupport.featureName "Name">
 <!ENTITY aboutSupport.featureVersion "Version">
 <!ENTITY aboutSupport.featureId "ID">
 
 <!ENTITY aboutSupport.experimentsTitle "Experimental Features">
 <!ENTITY aboutSupport.experimentName "Name">
 <!ENTITY aboutSupport.experimentId "ID">
--- a/toolkit/modules/Troubleshoot.jsm
+++ b/toolkit/modules/Troubleshoot.jsm
@@ -284,16 +284,37 @@ var dataProviders = {
         return props.reduce(function(extData, prop) {
           extData[prop] = ext[prop];
           return extData;
         }, {});
       }));
     });
   },
 
+  securitySoftware: function securitySoftware(done) {
+    let data = {};
+
+    let sysInfo = Cc["@mozilla.org/system-info;1"].
+                  getService(Ci.nsIPropertyBag2);
+
+    const keys = ["registeredAntiVirus", "registeredAntiSpyware",
+                  "registeredFirewall"];
+    for (let key of keys) {
+      let prop = "";
+      try {
+        prop = sysInfo.getProperty(key);
+      } catch (e) {
+      }
+
+      data[key] = prop;
+    }
+
+    done(data);
+  },
+
   features: function features(done) {
     AddonManager.getAddonsByTypes(["extension"], function(features) {
       features = features.filter(f => f.isSystem);
       features.sort(function(a, b) {
         // In some unfortunate cases addon names can be null.
         let aname = a.name || null;
         let bname = b.name || null;
         let lc = aname.localeCompare(bname);
--- a/toolkit/modules/tests/browser/browser_Troubleshoot.js
+++ b/toolkit/modules/tests/browser/browser_Troubleshoot.js
@@ -221,16 +221,34 @@ const SNAPSHOT_SCHEMA = {
           },
           isActive: {
             required: true,
             type: "boolean",
           },
         },
       },
     },
+    securitySoftware: {
+      required: false,
+      type: "object",
+      properties: {
+        registeredAntiVirus: {
+          required: true,
+          type: "string",
+        },
+        registeredAntiSpyware: {
+          required: true,
+          type: "string",
+        },
+        registeredFirewall: {
+          required: true,
+          type: "string",
+        },
+      },
+    },
     features: {
       required: true,
       type: "array",
       items: {
         type: "object",
         properties: {
           name: {
             required: true,