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
--- 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.