Bug 691579 - Get rid of broken multiple homepage code in startPage() r=gavin
authorMargaret Leibovic <margaret.leibovic@gmail.com>
Mon, 03 Oct 2011 16:28:13 -0700
changeset 78716 362872311015e1d8c570f641cf44b6392039779b
parent 78715 0371c608f12646d6885bf6229bf8ea785a6bbcc7
child 78717 da524e9568b6494a986753da2a24131a830c9eaf
push id506
push userclegnitto@mozilla.com
push dateWed, 09 Nov 2011 02:03:18 +0000
treeherdermozilla-aurora@63587fc7bb93 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgavin
bugs691579
milestone10.0a1
Bug 691579 - Get rid of broken multiple homepage code in startPage() r=gavin
browser/components/nsBrowserContentHandler.js
--- a/browser/components/nsBrowserContentHandler.js
+++ b/browser/components/nsBrowserContentHandler.js
@@ -643,46 +643,23 @@ nsBrowserContentHandler.prototype = {
     // Only show the startPage if we're not restoring an update session.
     if (overridePage && startPage && !haveUpdateSession)
       return overridePage + "|" + startPage;
 
     return overridePage || startPage || "about:blank";
   },
 
   get startPage() {
-    var prefb = Components.classes["@mozilla.org/preferences-service;1"]
-                          .getService(nsIPrefBranch);
-
-    var uri = prefb.getComplexValue("browser.startup.homepage",
-                                    nsIPrefLocalizedString).data;
-
+    var uri = Services.prefs.getComplexValue("browser.startup.homepage",
+                                             nsIPrefLocalizedString).data;
     if (!uri) {
-      prefb.clearUserPref("browser.startup.homepage");
-      uri = prefb.getComplexValue("browser.startup.homepage",
-                                  nsIPrefLocalizedString).data;
+      Services.prefs.clearUserPref("browser.startup.homepage");
+      uri = Services.prefs.getComplexValue("browser.startup.homepage",
+                                           nsIPrefLocalizedString).data;
     }
-                                
-    var count;
-    try {
-      count = prefb.getIntPref("browser.startup.homepage.count");
-    }
-    catch (e) {
-      return uri;
-    }
-
-    for (var i = 1; i < count; ++i) {
-      try {
-        var page = prefb.getComplexValue("browser.startup.homepage." + i,
-                                         nsIPrefLocalizedString).data;
-        uri += "\n" + page;
-      }
-      catch (e) {
-      }
-    }
-
     return uri;
   },
 
   mFeatures : null,
 
   getFeatures : function bch_features(cmdLine) {
     if (this.mFeatures === null) {
       this.mFeatures = "";