Bug 966020 - [Australis] Enable survey page temporarily for new Aurora builds with Australis. r=MattN a=sylvestre
authorSteven MacLeod <smacleod@mozilla.com>
Fri, 28 Feb 2014 12:40:29 -0500
changeset 183073 7b2e8bafe685aa51da1464f8cf686637e18c9e87
parent 183072 e2d7499fa0b5b704b2a5b22232dce3c8b26527e2
child 183074 74d3aa838c44b3297a973832f7ffc353491fa1c5
push id3343
push userffxbld
push dateMon, 17 Mar 2014 21:55:32 +0000
treeherdermozilla-beta@2f7d3415f79f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersMattN, sylvestre
bugs966020
milestone29.0a2
Bug 966020 - [Australis] Enable survey page temporarily for new Aurora builds with Australis. r=MattN a=sylvestre
browser/components/nsBrowserContentHandler.js
--- a/browser/components/nsBrowserContentHandler.js
+++ b/browser/components/nsBrowserContentHandler.js
@@ -568,16 +568,18 @@ nsBrowserContentHandler.prototype = {
       // 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) {
+        let locale = "en-US";
+
         switch (override) {
           case OVERRIDE_NEW_PROFILE:
             // New profile.
             overridePage = Services.urlFormatter.formatURLPref("startup.homepage_welcome_url");
             break;
           case OVERRIDE_NEW_MSTONE:
             // Check whether we will restore a session. If we will, we assume
             // that this is an "update" session. This does not take crashes
@@ -587,32 +589,52 @@ nsBrowserContentHandler.prototype = {
             var ss = Components.classes["@mozilla.org/browser/sessionstartup;1"]
                                .getService(Components.interfaces.nsISessionStartup);
             willRestoreSession = ss.isAutomaticRestoreEnabled();
 
             overridePage = Services.urlFormatter.formatURLPref("startup.homepage_override_url");
 
 #if MOZ_UPDATE_CHANNEL == aurora
             // Temporary Australis whatsnew page for Aurora (bug 966014)
-            let locale = "en-US";
             try {
               locale = Services.prefs.getCharPref("general.useragent.locale");
             } catch (e) {}
 
             if (locale == "en-US") {
               let url = "https://www.mozilla.org/%LOCALE%/firefox/%VERSION%/whatsnew/?oldversion=%OLD_VERSION%";
               overridePage = Services.urlFormatter.formatURL(url);
             }
 #endif
 
             if (prefb.prefHasUserValue("app.update.postupdate"))
               overridePage = getPostUpdateOverridePage(overridePage);
 
             overridePage = overridePage.replace("%OLD_VERSION%", old_mstone);
             break;
+
+#if MOZ_UPDATE_CHANNEL == aurora
+          case OVERRIDE_NEW_BUILD_ID:
+            try {
+              locale = Services.prefs.getCharPref("general.useragent.locale");
+            } catch (e) {}
+
+            let showedAustralisWhatsNew = false;
+            try {
+              showedAustralisWhatsNew = Services.prefs.
+                getBoolPref("browser.showedAustralisWhatsNew");
+            } catch (e) {}
+
+            // Show the Australis survey page for en-US if we haven't shown it.
+            if (!showedAustralisWhatsNew && locale == "en-US") {
+              Services.prefs.setBoolPref("browser.showedAustralisWhatsNew", true);
+              overridePage = "https://www.mozilla.org/en-US/firefox/aurora/up-to-date/"
+            }
+
+            break;
+#endif
         }
       }
     } catch (ex) {}
 
     // formatURLPref might return "about:blank" if getting the pref fails
     if (overridePage == "about:blank")
       overridePage = "";