Bug 1418131: Part 2 - Add security software section to about:support; r=jimm

MozReview-Commit-ID: 2hJkpPxFakp

--HG--
extra : rebase_source : 3774f9c6360a98287ac658270bcf040c900fe91e
This commit is contained in:
Aaron Klotz 2017-11-18 13:59:45 -07:00
Родитель 652524cb6b
Коммит 29af430043
4 изменённых файлов: 87 добавлений и 0 удалений

Просмотреть файл

@ -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", [

Просмотреть файл

@ -370,6 +370,53 @@
<!-- - - - - - - - - - - - - - - - - - - - - -->
<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>

Просмотреть файл

@ -25,6 +25,13 @@ This is likely the same like id.heading in crashes.dtd. -->
<!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">

Просмотреть файл

@ -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);