Bug 1131758 - indicate 64-bit windows or OSX/Linux incompatibilities for Adobe's CDM, r=dolske

This commit is contained in:
Gijs Kruitbosch 2015-02-23 11:51:48 +00:00
parent b64b73b27d
commit 1fde6b1197

View File

@ -89,9 +89,9 @@ let gEMEHandler = {
return;
}
this.showNotificationBar(browser, notificationId, params, buttonCallback);
this.showNotificationBar(browser, notificationId, keySystem, params, buttonCallback);
},
showNotificationBar: function(browser, notificationId, labelParams, callback) {
showNotificationBar: function(browser, notificationId, keySystem, labelParams, callback) {
let box = gBrowser.getNotificationBox(browser);
if (box.getNotificationWithValue(notificationId)) {
return;
@ -107,6 +107,18 @@ let gEMEHandler = {
let msgPrefix = "emeNotifications." + notificationId + ".";
let msgId = msgPrefix + "message";
// Specialcase Adobe's CDM on unsupported platforms to be more informative:
if (notificationId == "drmContentCDMNotSupported" &&
keySystem.startsWith("com.adobe")) {
let os = Services.appinfo.OS.toLowerCase();
if (os.startsWith("win") && Services.appinfo.XPCOMABI.startsWith("x86_64")) {
msgId = msgPrefix + "64bit.message";
} else if (os.startsWith("linux") || os.startsWith("darwin")) {
msgId = msgPrefix + "unsupportedOS.message";
labelParams.splice(1, 0, os.startsWith("linux") ? "Linux" : "Mac OS X");
}
}
let message = labelParams.length ?
gNavigatorBundle.getFormattedString(msgId, labelParams) :
gNavigatorBundle.getString(msgId);