Backed out changeset 80d218022132 (bug 1234355) for Android M12 Test failures on a CLOSED TREE

This commit is contained in:
Carsten "Tomcat" Book 2016-01-26 10:55:24 +01:00
parent 9b9db138b8
commit 4392870e01
4 changed files with 42 additions and 0 deletions

View File

@ -33,6 +33,16 @@ var gEMEHandler = {
return "<label class='text-link' href='" + baseURL + "drm-content'>" +
text + "</label>";
},
onDontAskAgain: function(menuPopupItem) {
let button = menuPopupItem.parentNode.anchorNode;
let bar = button.parentNode;
Services.prefs.setBoolPref("browser.eme.ui." + bar.value + ".disabled", true);
bar.close();
},
onNotNow: function(menuPopupItem) {
let button = menuPopupItem.parentNode.anchorNode;
button.parentNode.close();
},
receiveMessage: function({target: browser, data: data}) {
let parsedData;
try {
@ -95,6 +105,13 @@ var gEMEHandler = {
return;
}
// If the user turned these off, bail out:
try {
if (Services.prefs.getBoolPref("browser.eme.ui." + notificationId + ".disabled")) {
return;
}
} catch (ex) { /* Don't care if the pref doesn't exist */ }
let msgPrefix = "emeNotifications." + notificationId + ".";
let msgId = msgPrefix + "message";
@ -123,6 +140,13 @@ var gEMEHandler = {
accessKey: gNavigatorBundle.getString(btnAccessKeyId),
callback: callback
});
let optionsId = "emeNotifications.optionsButton";
buttons.push({
label: gNavigatorBundle.getString(optionsId + ".label"),
accessKey: gNavigatorBundle.getString(optionsId + ".accesskey"),
popup: "emeNotificationsPopup"
});
}
let iconURL = "chrome://browser/skin/drm-icon.svg#chains-black";

View File

@ -463,6 +463,17 @@
<tooltip id="dynamic-shortcut-tooltip"
onpopupshowing="UpdateDynamicShortcutTooltipText(this);"/>
<menupopup id="emeNotificationsPopup">
<menuitem id="emeNotificationsNotNow"
label="&emeNotificationsNotNow.label;"
acceskey="&emeNotificationsNotNow.accesskey;"
oncommand="gEMEHandler.onNotNow(this);"/>
<menuitem id="emeNotificationsDontAskAgain"
label="&emeNotificationsDontAskAgain.label;"
acceskey="&emeNotificationsDontAskAgain.accesskey;"
oncommand="gEMEHandler.onDontAskAgain(this);"/>
</menupopup>
</popupset>
#ifdef CAN_DRAW_IN_TITLEBAR

View File

@ -928,3 +928,7 @@ you can use these alternative items. Otherwise, their values should be empty. -
<!ENTITY emeLearnMoreContextMenu.label "Learn more about DRM…">
<!ENTITY emeLearnMoreContextMenu.accesskey "D">
<!ENTITY emeNotificationsNotNow.label "Not now">
<!ENTITY emeNotificationsNotNow.accesskey "N">
<!ENTITY emeNotificationsDontAskAgain.label "Don't ask me again">
<!ENTITY emeNotificationsDontAskAgain.accesskey "D">

View File

@ -692,6 +692,9 @@ emeNotifications.drmContentCDMNotSupported.64bit.message = The audio or video on
# LOCALIZATION NOTE(emeNotifications.drmContentCDMNotSupported.unsupportedOS.message): NB: inserted via innerHTML, so please don't use <, > or & in this string. %1$S is brandShortName, %2$S is the name of the user's OS (Windows, Linux, Mac OS X), %3$S will be the 'learn more' link
emeNotifications.drmContentCDMNotSupported.unsupportedOS.message = The audio or video on this page requires DRM software that %1$S does not support on %2$S. %3$S
emeNotifications.optionsButton.label = Options
emeNotifications.optionsButton.accesskey = O
emeNotifications.unknownDRMSoftware = Unknown
# LOCALIZATION NOTE - %S is brandShortName