From 9e9aa61c932170c485e6d38f7835f20aaca38afb Mon Sep 17 00:00:00 2001 From: Gavin Sharp Date: Fri, 4 Nov 2011 14:45:01 -0700 Subject: [PATCH] Bug 691951: make startup notifications persist until the users close them (disable auto-dismissal), r=zpao --HG-- extra : transplant_source : %16%B44%1C%03%FC%C3%04%00%EA%8E%A6%D5%96%16%F2%16O%D4%40 --- browser/components/nsBrowserGlue.js | 27 ++++++++++++++------------- build/automation.py.in | 2 +- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/browser/components/nsBrowserGlue.js b/browser/components/nsBrowserGlue.js index d851d67119b..6c68fb4c4f1 100644 --- a/browser/components/nsBrowserGlue.js +++ b/browser/components/nsBrowserGlue.js @@ -639,8 +639,8 @@ BrowserGlue.prototype = { var currentVersion = Services.prefs.getIntPref("browser.rights.version"); Services.prefs.setBoolPref("browser.rights." + currentVersion + ".shown", true); - var box = notifyBox.appendNotification(notifyRightsText, "about-rights", null, notifyBox.PRIORITY_INFO_LOW, buttons); - box.persistence = 3; // arbitrary number, just so bar sticks around for a bit + var notification = notifyBox.appendNotification(notifyRightsText, "about-rights", null, notifyBox.PRIORITY_INFO_LOW, buttons); + notification.persistence = -1; // Until user closes it }, _showUpdateNotification: function BG__showUpdateNotification() { @@ -709,10 +709,10 @@ BrowserGlue.prototype = { } ]; - let box = notifyBox.appendNotification(text, "post-update-notification", - null, notifyBox.PRIORITY_INFO_LOW, - buttons); - box.persistence = 3; + let notification = notifyBox.appendNotification(text, "post-update-notification", + null, notifyBox.PRIORITY_INFO_LOW, + buttons); + notification.persistence = -1; // Until user closes it } if (actions.indexOf("showAlert") == -1) @@ -815,7 +815,7 @@ BrowserGlue.prototype = { var notification = notifyBox.appendNotification(telemetryPrompt, "telemetry", null, notifyBox.PRIORITY_INFO_LOW, buttons); notification.setAttribute("hideclose", true); - notification.persistence = 6; // arbitrary number, just so bar sticks around for a bit + notification.persistence = -1; // Until user closes it let XULNS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"; let link = notification.ownerDocument.createElementNS(XULNS, "label"); @@ -827,8 +827,9 @@ BrowserGlue.prototype = { // Remove the notification on which the user clicked notification.parentNode.removeNotification(notification, true); // Add a new notification to that tab, with no "Learn more" link - var notifyBox = browser.getNotificationBox(); - notifyBox.appendNotification(telemetryPrompt, "telemetry", null, notifyBox.PRIORITY_INFO_LOW, buttons); + notifyBox = browser.getNotificationBox(); + notification = notifyBox.appendNotification(telemetryPrompt, "telemetry", null, notifyBox.PRIORITY_INFO_LOW, buttons); + notification.persistence = -1; // Until user closes it }, false); let description = notification.ownerDocument.getAnonymousElementByAttribute(notification, "anonid", "messageText"); description.appendChild(link); @@ -1092,10 +1093,10 @@ BrowserGlue.prototype = { ]; var notifyBox = browser.getNotificationBox(); - var box = notifyBox.appendNotification(text, title, null, - notifyBox.PRIORITY_CRITICAL_MEDIUM, - buttons); - box.persistence = -1; // Until user closes it + var notification = notifyBox.appendNotification(text, title, null, + notifyBox.PRIORITY_CRITICAL_MEDIUM, + buttons); + notification.persistence = -1; // Until user closes it }, _migrateUI: function BG__migrateUI() { diff --git a/build/automation.py.in b/build/automation.py.in index fb88e55dcd2..ce30cd9a644 100644 --- a/build/automation.py.in +++ b/build/automation.py.in @@ -428,7 +428,7 @@ user_pref("security.warn_viewing_mixed", false); user_pref("app.update.enabled", false); user_pref("browser.panorama.experienced_first_run", true); // Assume experienced user_pref("dom.w3c_touch_events.enabled", true); -user_pref("toolkit.telemetry.prompted", true); +user_pref("toolkit.telemetry.prompted", 2); // Only load extensions from the application and user profile // AddonManager.SCOPE_PROFILE + AddonManager.SCOPE_APPLICATION