B2G/gecko/browser/components/nsBrowserContentHandler.js
/**
 * Determines whether a home page override is needed.
 * Returns:
 *  OVERRIDE_NEW_PROFILE if this is the first run with a new profile.
 *  OVERRIDE_NEW_MSTONE if this is the first run with a build with a different
 *                      Gecko milestone (i.e. right after an upgrade).
 *  OVERRIDE_NEW_BUILD_ID if this is the first run with a new build ID of the
 *                        same Gecko milestone (i.e. after a nightly upgrade).
 *  OVERRIDE_NONE otherwise.
 */
Determines whether a home page override is needed.
Returns:
OVERRIDE_NEW_PROFILE if this is the first run with a new profile.
OVERRIDE_NEW_MSTONE if this is the first run with a build with a different
Gecko milestone .
OVERRIDE_NEW_BUILD_ID if this is the first run with a new build ID of the
same Gecko milestone .
Determines whether a home page override is needed . Returns : OVERRIDE_NEW_PROFILE if this is the first run with a new profile . OVERRIDE_NEW_MSTONE if this is the first run with a build with a different Gecko milestone . OVERRIDE_NEW_BUILD_ID if this is the first run with a new build ID of the same Gecko milestone .
function needHomepageOverride(prefb) {
  var savedmstone = null;
  try {
    savedmstone = prefb.getCharPref("browser.startup.homepage_override.mstone");
  } catch (e) {}
  if (savedmstone == "ignore")
    return OVERRIDE_NONE;
  var mstone = Services.appinfo.platformVersion;
  var savedBuildID = null;
  try {
    savedBuildID = prefb.getCharPref("browser.startup.homepage_override.buildID");
  } catch (e) {}
  var buildID = Services.appinfo.platformBuildID;
  if (mstone != savedmstone) {
    if (savedmstone)
      prefb.setBoolPref("browser.rights.3.shown", true);
    prefb.setCharPref("browser.startup.homepage_override.mstone", mstone);
    prefb.setCharPref("browser.startup.homepage_override.buildID", buildID);
    return (savedmstone ? OVERRIDE_NEW_MSTONE : OVERRIDE_NEW_PROFILE);
  }
  if (buildID != savedBuildID) {
    prefb.setCharPref("browser.startup.homepage_override.buildID", buildID);
    return OVERRIDE_NEW_BUILD_ID;
  }
  return OVERRIDE_NONE;
}
function needHomepageOverride ( prefb ) { var savedmstone = null ; try { savedmstone = prefb . getCharPref ( "browser.startup.homepage_override.mstone" ) ; } catch ( e ) { } if ( savedmstone == "ignore" ) return OVERRIDE_NONE ; var mstone = Services . appinfo . platformVersion ; var savedBuildID = null ; try { savedBuildID = prefb . getCharPref ( "browser.startup.homepage_override.buildID" ) ; } catch ( e ) { } var buildID = Services . appinfo . platformBuildID ; if ( mstone != savedmstone ) { if ( savedmstone ) prefb . setBoolPref ( "browser.rights.3.shown" , true ) ; prefb . setCharPref ( "browser.startup.homepage_override.mstone" , mstone ) ; prefb . setCharPref ( "browser.startup.homepage_override.buildID" , buildID ) ; return ( savedmstone ? OVERRIDE_NEW_MSTONE : OVERRIDE_NEW_PROFILE ) ; } if ( buildID != savedBuildID ) { prefb . setCharPref ( "browser.startup.homepage_override.buildID" , buildID ) ; return OVERRIDE_NEW_BUILD_ID ; } return OVERRIDE_NONE ; }
Determines whether a home page override is needed.
Determines whether a home page override is needed .
// Bug 462254. Previous releases had a default pref to suppress the EULA // agreement if the platform's installer had already shown one. Now with // about:rights we've removed the EULA stuff and default pref, but we need // a way to make existing profiles retain the default that we removed.