Bug 1247056 - More flexible SUMO link - r=gijs
☠☠ backed out by 2ae91c5e5354 ☠ ☠
authorGerald Squelart <gsquelart@mozilla.com>
Sun, 18 Sep 2016 22:23:49 -0700
changeset 315060 e1e5be2fc586
parent 315059 f48fd90bf839
child 315061 13434fa439d1
push id82043
push usergsquelart@mozilla.com
push dateFri, 23 Sep 2016 11:29:56 +0000
treeherdermozilla-inbound@13434fa439d1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgijs
bugs1247056
milestone52.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1247056 - More flexible SUMO link - r=gijs Instead of always pointing to the same fix-video-audio-problems-firefox-windows SUMO page, make it possible to point at others depending on the issue. Also we won't show a "Learn How" button for WinXP anymore, as the linked page is not relevant to XP, and CDMs are not available on XP anyway. MozReview-Commit-ID: 7YR43Wa0IRe
browser/base/content/browser-media.js
--- a/browser/base/content/browser-media.js
+++ b/browser/base/content/browser-media.js
@@ -196,20 +196,16 @@ XPCOMUtils.defineLazyGetter(gEMEHandler,
 
 const TELEMETRY_DDSTAT_SHOWN = 0;
 const TELEMETRY_DDSTAT_SHOWN_FIRST = 1;
 const TELEMETRY_DDSTAT_CLICKED = 2;
 const TELEMETRY_DDSTAT_CLICKED_FIRST = 3;
 const TELEMETRY_DDSTAT_SOLVED = 4;
 
 let gDecoderDoctorHandler = {
-  shouldShowLearnMoreButton() {
-    return AppConstants.platform == "win";
-  },
-
   getLabelForNotificationBox(type) {
     if (type == "adobe-cdm-not-found" &&
         AppConstants.platform == "win") {
       if (AppConstants.isPlatformAndVersionAtMost("win", "5.9")) {
         // We supply our own Learn More button so we don't need to populate the message here.
         return gNavigatorBundle.getFormattedString("emeNotifications.drmContentDisabled.message", [""]);
       }
       return gNavigatorBundle.getString("decoder.noCodecs.message");
@@ -233,16 +229,26 @@ let gDecoderDoctorHandler = {
       }
       if (AppConstants.platform == "linux") {
         return gNavigatorBundle.getString("decoder.noCodecsLinux.message");
       }
     }
     return "";
   },
 
+  getSumoForLearnHowButton(type) {
+    if (AppConstants.isPlatformAndVersionAtLeast("win", "6")) {
+      if (type == "adobe-cdm-not-activated" ||
+          type == "platform-decoder-not-found") {
+        return "fix-video-audio-problems-firefox-windows";
+      }
+    }
+    return "";
+  },
+
   receiveMessage({target: browser, data: data}) {
     let box = gBrowser.getNotificationBox(browser);
     let notificationId = "decoder-doctor-notification";
     if (box.getNotificationWithValue(notificationId)) {
       return;
     }
 
     let parsedData;
@@ -301,31 +307,32 @@ let gDecoderDoctorHandler = {
         if (newbies.length) {
           Services.prefs.setCharPref(formatsPref,
                                      existing.concat(newbies).join(", "));
         }
       }
       histogram.add(decoderDoctorReportId, TELEMETRY_DDSTAT_SHOWN);
 
       let buttons = [];
-      if (gDecoderDoctorHandler.shouldShowLearnMoreButton()) {
+      let sumo = gDecoderDoctorHandler.getSumoForLearnHowButton(type);
+      if (sumo) {
         buttons.push({
           label: gNavigatorBundle.getString("decoder.noCodecs.button"),
           accessKey: gNavigatorBundle.getString("decoder.noCodecs.accesskey"),
           callback() {
             let clickedInPref = Services.prefs.getPrefType(buttonClickedPref) &&
                                 Services.prefs.getBoolPref(buttonClickedPref);
             if (!clickedInPref) {
               Services.prefs.setBoolPref(buttonClickedPref, true);
               histogram.add(decoderDoctorReportId, TELEMETRY_DDSTAT_CLICKED_FIRST);
             }
             histogram.add(decoderDoctorReportId, TELEMETRY_DDSTAT_CLICKED);
 
             let baseURL = Services.urlFormatter.formatURLPref("app.support.baseURL");
-            openUILinkIn(baseURL + "fix-video-audio-problems-firefox-windows", "tab");
+            openUILinkIn(baseURL + sumo, "tab");
           }
         });
       }
 
       box.appendNotification(
           title,
           notificationId,
           "", // This uses the info icon as specified below.