From 4392870e01287d9efd7f78eb10c1ea1cce2bfd28 Mon Sep 17 00:00:00 2001 From: "Carsten \"Tomcat\" Book" Date: Tue, 26 Jan 2016 10:55:24 +0100 Subject: [PATCH] Backed out changeset 80d218022132 (bug 1234355) for Android M12 Test failures on a CLOSED TREE --- browser/base/content/browser-eme.js | 24 +++++++++++++++++++ browser/base/content/browser.xul | 11 +++++++++ .../locales/en-US/chrome/browser/browser.dtd | 4 ++++ .../en-US/chrome/browser/browser.properties | 3 +++ 4 files changed, 42 insertions(+) diff --git a/browser/base/content/browser-eme.js b/browser/base/content/browser-eme.js index d26e8835f35..fe3b0477299 100644 --- a/browser/base/content/browser-eme.js +++ b/browser/base/content/browser-eme.js @@ -33,6 +33,16 @@ var gEMEHandler = { return ""; }, + 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"; diff --git a/browser/base/content/browser.xul b/browser/base/content/browser.xul index c8781fd8b6a..177eddf056e 100644 --- a/browser/base/content/browser.xul +++ b/browser/base/content/browser.xul @@ -463,6 +463,17 @@ + + + + + #ifdef CAN_DRAW_IN_TITLEBAR diff --git a/browser/locales/en-US/chrome/browser/browser.dtd b/browser/locales/en-US/chrome/browser/browser.dtd index f1b412ad4f5..33fc154d81f 100644 --- a/browser/locales/en-US/chrome/browser/browser.dtd +++ b/browser/locales/en-US/chrome/browser/browser.dtd @@ -928,3 +928,7 @@ you can use these alternative items. Otherwise, their values should be empty. - + + + + diff --git a/browser/locales/en-US/chrome/browser/browser.properties b/browser/locales/en-US/chrome/browser/browser.properties index de7076f455c..a8bed95e0dc 100644 --- a/browser/locales/en-US/chrome/browser/browser.properties +++ b/browser/locales/en-US/chrome/browser/browser.properties @@ -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