Bug 1247056 - More flexible SUMO link - r=Gijs
authorGerald Squelart <gsquelart@mozilla.com>
Tue, 27 Sep 2016 00:03:06 -0700
changeset 315339 93c70da4ed72
parent 315338 a7b60f7a950b
child 315340 25be34cfa5ad
push id30748
push usercbook@mozilla.com
push dateWed, 28 Sep 2016 13:53:19 +0000
treeherdermozilla-central@8c84b7618840 [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,23 @@ let gDecoderDoctorHandler = {
       }
       if (AppConstants.platform == "linux") {
         return gNavigatorBundle.getString("decoder.noCodecsLinux.message");
       }
     }
     return "";
   },
 
+  getSumoForLearnHowButton(type) {
+    if (AppConstants.platform == "win") {
+      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 +304,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.