Bug 719868 - Progress throbber still shows when we load about:home on startup. r=mfinkle
authorMargaret Leibovic <margaret.leibovic@gmail.com>
Thu, 26 Jan 2012 15:07:38 -0800
changeset 87034 042092c83f226993dc822bc8d16c0db6b547018c
parent 87033 c0fa1e61c61933710f1d25c480a29a9779368fec
child 87035 4b41e38a1f131e29c491ba26ee4cea0d89f53899
push id805
push userakeybl@mozilla.com
push dateWed, 01 Feb 2012 18:17:35 +0000
treeherdermozilla-aurora@6fb3bf232436 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmfinkle
bugs719868
milestone12.0a1
Bug 719868 - Progress throbber still shows when we load about:home on startup. r=mfinkle
mobile/android/chrome/content/browser.js
--- a/mobile/android/chrome/content/browser.js
+++ b/mobile/android/chrome/content/browser.js
@@ -304,26 +304,26 @@ var BrowserApp = {
       }
 
       // Be ready to handle any restore failures by making sure we have a valid tab opened
       let restoreCleanup = {
         observe: function(aSubject, aTopic, aData) {
           Services.obs.removeObserver(restoreCleanup, "sessionstore-windows-restored");
           if (aData == "fail") {
             let params = { selected: restoreToFront };
-            BrowserApp.addTab("about:home");
+            BrowserApp.addTab("about:home", { showProgress: false });
           }
         }
       };
       Services.obs.addObserver(restoreCleanup, "sessionstore-windows-restored", false);
 
       // Start the restore
       ss.restoreLastSession(restoreToFront, forceRestore);
     } else {
-      this.addTab(url);
+      this.addTab(url, { showProgress: url != "about:home" });
 
       // show telemetry door hanger if we aren't restoring a session
       this._showTelemetryPrompt();
     }
 
     // notify java that gecko has loaded
     sendMessageToJava({
       gecko: {
@@ -464,21 +464,22 @@ var BrowserApp = {
         };
         sendMessageToJava(message);
         dump("Handled load error: " + e)
       }
     }
   },
 
   addTab: function addTab(aURI, aParams) {
-    aParams = aParams || { selected: true, flags: Ci.nsIWebNavigation.LOAD_FLAGS_NONE };
+    aParams = aParams || {};
+
     let newTab = new Tab(aURI, aParams);
     this._tabs.push(newTab);
-    if ("selected" in aParams && aParams.selected)
-      newTab.active = true;
+
+    newTab.active = "selected" in aParams ? aParams.selected : true;
 
     let evt = document.createEvent("UIEvents");
     evt.initUIEvent("TabOpen", true, false, window, null);
     newTab.browser.dispatchEvent(evt);
 
     return newTab;
   },
 
@@ -1406,17 +1407,17 @@ function Tab(aURL, aParams) {
   this._pluginOverlayShowing = false;
 }
 
 Tab.prototype = {
   create: function(aURL, aParams) {
     if (this.browser)
       return;
 
-    aParams = aParams || { selected: true };
+    aParams = aParams || {};
 
     this.vbox = document.createElement("vbox");
     this.vbox.align = "start";
     BrowserApp.deck.appendChild(this.vbox);
 
     this.browser = document.createElement("browser");
     this.browser.setAttribute("type", "content");
     this.setBrowserSize(980, 480);