Bug 1221330 - Show the app icon in the XUL upgraded notifications alert

This commit is contained in:
janekptacijarabaci 2018-04-26 10:23:42 +02:00 committed by Roy Tam
commit 4238f1570d

View file

@ -1414,7 +1414,10 @@ BrowserGlue.prototype = {
let win = RecentWindow.getMostRecentBrowserWindow();
win.openUILinkIn(data, "tab");
}
let imageURL = "chrome://browser/skin/web-notifications-icon.svg";
// Show the application icon for XUL notifications. We assume system-level
// notifications will include their own icon.
let imageURL = this._hasSystemAlertsService() ? "" :
"chrome://branding/content/about-logo.png";
let title = gBrowserBundle.GetStringFromName("webNotifications.upgradeTitle");
let text = gBrowserBundle.GetStringFromName("webNotifications.upgradeBody");
let url = Services.urlFormatter.formatURLPref("browser.push.warning.infoURL");
@ -1428,6 +1431,14 @@ BrowserGlue.prototype = {
}
},
_hasSystemAlertsService: function() {
try {
return !!Cc["@mozilla.org/system-alerts-service;1"].getService(
Ci.nsIAlertsService);
} catch (e) {}
return false;
},
_getPersist: function BG__getPersist(aSource, aProperty) {
var target = this._dataSource.GetTarget(aSource, aProperty, true);
if (target instanceof Ci.nsIRDFLiteral)