Bug 920236 - Add a pref to display a page on first run after install/upgrade r=mbrubeck a=lsblakk
authorMarina Samuel <msamuel@mozilla.com>
Fri, 13 Dec 2013 13:42:02 -0800
changeset 174472 b165819fa20d5232d0620cf2cfd9590b653ed7b0
parent 174471 274f1e06b821c2eb3e76a64fbbecf965fa99514f
child 174473 7153471fbb04be31cb29cab8eef510a076d06fb6
push id3224
push userlsblakk@mozilla.com
push dateTue, 04 Feb 2014 01:06:49 +0000
treeherdermozilla-beta@60c04d0987f1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmbrubeck, lsblakk
bugs920236
milestone28.0a2
Bug 920236 - Add a pref to display a page on first run after install/upgrade r=mbrubeck a=lsblakk
browser/metro/components/BrowserCLH.js
--- a/browser/metro/components/BrowserCLH.js
+++ b/browser/metro/components/BrowserCLH.js
@@ -56,17 +56,17 @@ function needHomepageOverride() {
   let savedmstone = null;
   try {
     savedmstone = Services.prefs.getCharPref("browser.startup.homepage_override.mstone");
   } catch (e) {}
 
   if (savedmstone == "ignore")
     return "none";
 
-#expand    let ourmstone = "__MOZ_APP_VERSION__";
+  let ourmstone = Services.appinfo.platformVersion;
 
   if (ourmstone != savedmstone) {
     Services.prefs.setCharPref("browser.startup.homepage_override.mstone", ourmstone);
 
     return (savedmstone ? "new version" : "new profile");
   }
 
   return "none";
@@ -217,16 +217,21 @@ BrowserCLH.prototype = {
         return;
       }
 
       browserWin = Services.wm.getMostRecentWindow("navigator:browser");
       if (!browserWin) {
         // Default to the saved homepage
         let defaultURL = getHomePage();
 
+        // Show page for first run or upgrade.
+        if (needHomepageOverride() == "new profile") {
+          defaultURL = 'about:newtab?firstrun';
+        }
+
         // Override the default if we have a URL passed on command line
         if (uris.length > 0) {
           defaultURL = uris[0].spec;
           uris = uris.slice(1);
         }
 
         // Show the locale selector if we have a new profile, or if the selected locale is no longer compatible
         let showLocalePicker = Services.prefs.getBoolPref("browser.firstrun.show.localepicker");