Bug 1276132 - Don't show EME 'enable' UI for non-visible keysystems. r=gijs

This means we'll only show the EME UI for keysystems that are explicitly turned
on in the build config, or those that are enabled after the build via prefs.

MozReview-Commit-ID: 7VTp1BJSZFy

--HG--
extra : rebase_source : 6a31f9d8fc2f06ef05988b510946ed924c613c2a
This commit is contained in:
Chris Pearce 2016-05-31 12:04:12 +12:00
parent 91ab2bc0c4
commit 359a1add5d

View File

@ -31,6 +31,20 @@ var gEMEHandler = {
}
browser.reload();
},
isKeySystemVisible: function(keySystem) {
if (!keySystem) {
return false;
}
if (keySystem.startsWith("com.adobe") &&
Services.prefs.getPrefType("media.gmp-eme-adobe.visible")) {
return Services.prefs.getBoolPref("media.gmp-eme-adobe.visible");
}
if (keySystem == "com.widevine.alpha" &&
Services.prefs.getPrefType("media.gmp-widevinecdm.visible")) {
return Services.prefs.getBoolPref("media.gmp-widevinecdm.visible");
}
return true;
},
getLearnMoreLink: function(msgId) {
let text = gNavigatorBundle.getString("emeNotifications." + msgId + ".learnMoreLabel");
let baseURL = Services.urlFormatter.formatURLPref("app.support.baseURL");
@ -46,8 +60,8 @@ var gEMEHandler = {
return;
}
let {status: status, keySystem: keySystem} = parsedData;
// Don't need to show if disabled
if (!this.uiEnabled) {
// Don't need to show if disabled or keysystem not visible.
if (!this.uiEnabled || !this.isKeySystemVisible(keySystem)) {
return;
}