From 29af430043819b58e14b084d0fa03f2f21192198 Mon Sep 17 00:00:00 2001 From: Aaron Klotz Date: Sat, 18 Nov 2017 13:59:45 -0700 Subject: [PATCH] Bug 1418131: Part 2 - Add security software section to about:support; r=jimm MozReview-Commit-ID: 2hJkpPxFakp --HG-- extra : rebase_source : 3774f9c6360a98287ac658270bcf040c900fe91e --- toolkit/content/aboutSupport.js | 12 +++++ toolkit/content/aboutSupport.xhtml | 47 +++++++++++++++++++ .../en-US/chrome/global/aboutSupport.dtd | 7 +++ toolkit/modules/Troubleshoot.jsm | 21 +++++++++ 4 files changed, 87 insertions(+) diff --git a/toolkit/content/aboutSupport.js b/toolkit/content/aboutSupport.js index 7215a852c204..2efffed0334d 100644 --- a/toolkit/content/aboutSupport.js +++ b/toolkit/content/aboutSupport.js @@ -183,6 +183,18 @@ var snapshotFormatters = { })); }, + 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", [ diff --git a/toolkit/content/aboutSupport.xhtml b/toolkit/content/aboutSupport.xhtml index 8fa80981381b..fe34d74a9ab8 100644 --- a/toolkit/content/aboutSupport.xhtml +++ b/toolkit/content/aboutSupport.xhtml @@ -370,6 +370,53 @@ +

+ &aboutSupport.securitySoftwareTitle; +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ &aboutSupport.securitySoftwareType; + + &aboutSupport.securitySoftwareName; +
+ &aboutSupport.securitySoftwareAntivirus; + +
+ &aboutSupport.securitySoftwareAntiSpyware; + +
+ &aboutSupport.securitySoftwareFirewall; + +
+ + +

&aboutSupport.graphicsTitle;

diff --git a/toolkit/locales/en-US/chrome/global/aboutSupport.dtd b/toolkit/locales/en-US/chrome/global/aboutSupport.dtd index 6ab00a6d636c..857243af6a09 100644 --- a/toolkit/locales/en-US/chrome/global/aboutSupport.dtd +++ b/toolkit/locales/en-US/chrome/global/aboutSupport.dtd @@ -25,6 +25,13 @@ This is likely the same like id.heading in crashes.dtd. --> + + + + + + + diff --git a/toolkit/modules/Troubleshoot.jsm b/toolkit/modules/Troubleshoot.jsm index 1a55c5173a4a..db7181a0db6b 100644 --- a/toolkit/modules/Troubleshoot.jsm +++ b/toolkit/modules/Troubleshoot.jsm @@ -289,6 +289,27 @@ var dataProviders = { }); }, + 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);