Bug 739793: add old version to post-update whatsnew URL to allow differentiating various upgrade scenarios, r=mak

--HG--
extra : transplant_source : %94%F1O%DEK%D0n%F3%F5%07%7D%20%C7%E2%C6%3C%922%01%DB
This commit is contained in:
Gavin Sharp 2012-03-28 09:56:56 -07:00
parent 9dd56c77d3
commit 46e59eb863
3 changed files with 13 additions and 2 deletions

View File

@ -1,4 +1,4 @@
pref("startup.homepage_override_url","http://www.mozilla.org/projects/%APP%/%VERSION%/whatsnew/");
pref("startup.homepage_override_url","http://www.mozilla.org/projects/%APP%/%VERSION%/whatsnew/?oldversion=%OLD_VERSION%");
pref("startup.homepage_welcome_url","http://www.mozilla.org/projects/%APP%/%VERSION%/firstrun/");
// The time interval between checks for a new version (in seconds)
pref("app.update.interval", 3600); // 1 hour

View File

@ -1,4 +1,4 @@
pref("startup.homepage_override_url","http://www.mozilla.com/%LOCALE%/%APP%/%VERSION%/whatsnew/");
pref("startup.homepage_override_url","http://www.mozilla.com/%LOCALE%/%APP%/%VERSION%/whatsnew/?oldversion=%OLD_VERSION%");
pref("startup.homepage_welcome_url","http://www.mozilla.com/%LOCALE%/%APP%/%VERSION%/firstrun/");
// Interval: Time between checks for a new version (in seconds)
// nightly=6 hours, official=24 hours

View File

@ -581,6 +581,15 @@ nsBrowserContentHandler.prototype = {
var overridePage = "";
var haveUpdateSession = false;
try {
// Read the old value of homepage_override.mstone before
// needHomepageOverride updates it, so that we can later add it to the
// URL if we do end up showing an overridePage. This makes it possible
// to have the overridePage's content vary depending on the version we're
// upgrading from.
let old_mstone = "unknown";
try {
old_mstone = Services.prefs.getCharPref("browser.startup.homepage_override.mstone");
} catch (ex) {}
let override = needHomepageOverride(prefb);
if (override != OVERRIDE_NONE) {
// Setup the default search engine to about:home page.
@ -604,6 +613,8 @@ nsBrowserContentHandler.prototype = {
overridePage = Services.urlFormatter.formatURLPref("startup.homepage_override_url");
if (prefb.prefHasUserValue("app.update.postupdate"))
overridePage = getPostUpdateOverridePage(overridePage);
overridePage = overridePage.replace("%OLD_VERSION%", old_mstone);
break;
}
}