Bug 1256186 - Part 2 - Remove the handler in chrome against MediaKeySystemStatus 'cdm-not-supported' and related strings to avoid confusing users.; r=Gijs. draft
authorKilik Kuo <kikuo@mozilla.com>
Wed, 06 Apr 2016 15:38:00 +0800
changeset 347972 380d52b75ee9a2bae387577d9345b900b8470844
parent 346554 e5f2b0e0d640d2c553661b2dd9b752d3a0918a46
child 347973 309314108d470b8fbc2bb7e1e47e25c0a87c64a9
push id14713
push userkikuo@mozilla.com
push dateWed, 06 Apr 2016 07:39:11 +0000
reviewersGijs
bugs1256186
milestone48.0a1
Bug 1256186 - Part 2 - Remove the handler in chrome against MediaKeySystemStatus 'cdm-not-supported' and related strings to avoid confusing users.; r=Gijs. MozReview-Commit-ID: J5sG0MtaeLG
browser/base/content/browser-eme.js
browser/locales/en-US/chrome/browser/browser.properties
--- a/browser/base/content/browser-eme.js
+++ b/browser/base/content/browser-eme.js
@@ -59,31 +59,29 @@ var gEMEHandler = {
 
       case "api-disabled":
       case "cdm-disabled":
         notificationId = "drmContentDisabled";
         buttonCallback = gEMEHandler.ensureEMEEnabled.bind(gEMEHandler, browser, keySystem)
         params = [this.getLearnMoreLink(notificationId)];
         break;
 
-      case "cdm-not-supported":
-        notificationId = "drmContentCDMNotSupported";
-        params = [this._brandShortName, this.getLearnMoreLink(notificationId)];
-        break;
-
       case "cdm-insufficient-version":
         notificationId = "drmContentCDMInsufficientVersion";
         params = [this._brandShortName];
         break;
 
       case "cdm-not-installed":
         notificationId = "drmContentCDMInstalling";
         params = [this._brandShortName];
         break;
 
+      case "cdm-not-supported":
+        // Not to pop up user-level notification because they cannot do anything
+        // about it.
       case "error":
         // Fall through and do the same for unknown messages:
       default:
         let typeOfIssue = status == "error" ? "error" : "message ('" + status + "')";
         Cu.reportError("Unknown " + typeOfIssue + " dealing with EME key request: " + data);
         return;
     }
 
@@ -93,26 +91,16 @@ var gEMEHandler = {
     let box = gBrowser.getNotificationBox(browser);
     if (box.getNotificationWithValue(notificationId)) {
       return;
     }
 
     let msgPrefix = "emeNotifications." + notificationId + ".";
     let msgId = msgPrefix + "message";
 
-    // Special-case Adobe's CDM message on unsupported platforms to be more informative:
-    if (notificationId == "drmContentCDMNotSupported" &&
-        keySystem.startsWith("com.adobe")) {
-      let os = Services.appinfo.OS.toLowerCase();
-      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);
 
     let buttons = [];
     if (callback) {
       let btnLabelId = msgPrefix + "button.label";
       let btnAccessKeyId = msgPrefix + "button.accesskey";
@@ -135,17 +123,16 @@ var gEMEHandler = {
 
     box.appendNotification(fragment, notificationId, iconURL, box.PRIORITY_WARNING_MEDIUM,
                            buttons);
   },
   showPopupNotificationForSuccess: function(browser, keySystem) {
     // We're playing EME content! Remove any "we can't play because..." messages.
     var box = gBrowser.getNotificationBox(browser);
     ["drmContentDisabled",
-     "drmContentCDMNotSupported",
      "drmContentCDMInsufficientVersion",
      "drmContentCDMInstalling"
      ].forEach(function (value) {
         var notification = box.getNotificationWithValue(value);
         if (notification)
           box.removeNotification(notification);
       });
 
--- a/browser/locales/en-US/chrome/browser/browser.properties
+++ b/browser/locales/en-US/chrome/browser/browser.properties
@@ -635,30 +635,22 @@ emeNotifications.drmContentPlaying.butto
 
 # LOCALIZATION NOTE(emeNotifications.drmContentDisabled.message): NB: inserted via innerHTML, so please don't use <, > or & in this string. %S will be the 'learn more' link
 emeNotifications.drmContentDisabled.message = You must enable DRM to play some audio or video on this page. %S
 emeNotifications.drmContentDisabled.button.label = Enable DRM
 emeNotifications.drmContentDisabled.button.accesskey = E
 # LOCALIZATION NOTE(emeNotifications.drmContentDisabled.learnMoreLabel): NB: inserted via innerHTML, so please don't use <, > or & in this string.
 emeNotifications.drmContentDisabled.learnMoreLabel = Learn More
 
-# LOCALIZATION NOTE(emeNotifications.drmContentCDMNotSupported.message): NB: inserted via innerHTML, so please don't use <, > or & in this string. %1$S is brandShortName, %2$S will be the 'learn more' link
-emeNotifications.drmContentCDMNotSupported.message = The audio or video on this page requires DRM software that %1$S does not support. %2$S
-# LOCALIZATION NOTE(emeNotifications.drmContentCDMNotSupported.learnMoreLabel): NB: inserted via innerHTML, so please don't use <, > or & in this string.
-emeNotifications.drmContentCDMNotSupported.learnMoreLabel = Learn More
-
 # LOCALIZATION NOTE(emeNotifications.drmContentCDMInsufficientVersion.message): NB: inserted via innerHTML, so please don't use <, > or & in this string. %S is brandShortName
 emeNotifications.drmContentCDMInsufficientVersion.message = %S is installing updates needed to play the audio or video on this page. Please try again later.
 
 # LOCALIZATION NOTE(emeNotifications.drmContentCDMInstalling.message): NB: inserted via innerHTML, so please don't use <, > or & in this string. %S is brandShortName
 emeNotifications.drmContentCDMInstalling.message = %S is installing components needed to play the audio or video on this page. Please try again later.
 
-# 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.unknownDRMSoftware = Unknown
 
 # LOCALIZATION NOTE - %S is brandShortName
 slowStartup.message = %S seems slow… to… start.
 slowStartup.helpButton.label = Learn How to Speed It Up
 slowStartup.helpButton.accesskey = L
 slowStartup.disableNotificationButton.label = Don't Tell Me Again
 slowStartup.disableNotificationButton.accesskey = A