Bug 956741 - Load first run on start page for the first 3 tabs. r=mbrubeck, a=lsblakk
authorRodrigo Silveira <rsilveira@mozilla.com>
Thu, 09 Jan 2014 14:02:47 -0800
changeset 175804 701137e8b96bc29574a55178359624eaa326a562
parent 175803 4a9deaf0a699c152c4974bc6a68db80f666eaabd
child 175805 a1a43efa0c4467d0f34543d5d73bfde10bcac5a8
push id445
push userffxbld
push dateMon, 10 Mar 2014 22:05:19 +0000
treeherdermozilla-release@dc38b741b04e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmbrubeck, lsblakk
bugs956741
milestone28.0a2
Bug 956741 - Load first run on start page for the first 3 tabs. r=mbrubeck, a=lsblakk
browser/metro/base/content/startui/StartUI.js
browser/metro/components/BrowserCLH.js
browser/metro/profile/metro.js
testing/profiles/prefs_general.js
--- a/browser/metro/base/content/startui/StartUI.js
+++ b/browser/metro/base/content/startui/StartUI.js
@@ -21,19 +21,20 @@ var StartUI = {
   init: function init() {
     this.startUI.addEventListener("click", this, false);
     this.startUI.addEventListener("MozMousePixelScroll", this, false);
 
     // Update the input type on our local broadcaster
     document.getElementById("bcast_preciseInput").setAttribute("input",
       this.chromeWin.InputSourceHelper.isPrecise ? "precise" : "imprecise");
 
-    // NOTE: location.search doesn't work for about: pages
-    if (location.href.indexOf("?firstrun") > 0) {
+    let firstRunCount = Services.prefs.getIntPref("browser.firstrun.count");
+    if (firstRunCount > 0) {
       document.loadOverlay("chrome://browser/content/FirstRunOverlay.xul", null);
+      Services.prefs.setIntPref("browser.firstrun.count", firstRunCount - 1);
     }
 
     this._adjustDOMforViewState(this.chromeWin.ContentAreaObserver.viewstate);
 
     TopSitesStartView.init();
     BookmarksStartView.init();
     HistoryStartView.init();
     RemoteTabsStartView.init();
--- a/browser/metro/components/BrowserCLH.js
+++ b/browser/metro/components/BrowserCLH.js
@@ -217,21 +217,16 @@ 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");
--- a/browser/metro/profile/metro.js
+++ b/browser/metro/profile/metro.js
@@ -116,16 +116,19 @@ pref("network.protocol-handler.external.
 pref("browser.display.overlaynavbuttons", true);
 
 /* history max results display */
 pref("browser.display.history.maxresults", 100);
 
 /* max items per section of the startui */
 pref("browser.display.startUI.maxresults", 16);
 
+// Number of times to display firstrun instructions on new tab page
+pref("browser.firstrun.count", 3);
+
 // Backspace and Shift+Backspace behavior
 // 0 goes Back/Forward
 // 1 act like PgUp/PgDown
 // 2 and other values, nothing
 pref("browser.backspace_action", 0);
 
 /* session history */
 pref("browser.sessionhistory.max_entries", 50);
--- a/testing/profiles/prefs_general.js
+++ b/testing/profiles/prefs_general.js
@@ -149,8 +149,12 @@ user_pref("geo.provider.testing", true);
 
 // Background thumbnails in particular cause grief, and disabling thumbnails
 // in general can't hurt - we re-enable them when tests need them.
 user_pref("browser.pagethumbnails.capturing_disabled", true);
 
 // Indicate that the download panel has been shown once so that whichever
 // download test runs first doesn't show the popup inconsistently.
 user_pref("browser.download.panel.shown", true);
+
+// prefs for firefox metro.
+// Disable first-tun tab
+user_pref("browser.firstrun.count", 0);