diff --git a/mobile/android/base/GeckoApp.java b/mobile/android/base/GeckoApp.java index cc8f5a209903..c697ce0e3053 100644 --- a/mobile/android/base/GeckoApp.java +++ b/mobile/android/base/GeckoApp.java @@ -893,7 +893,8 @@ abstract public class GeckoApp if ((state & GeckoAppShell.WPL_STATE_IS_NETWORK) != 0) { if ((state & GeckoAppShell.WPL_STATE_START) != 0) { Log.i(LOGTAG, "Got a document start"); - handleDocumentStart(tabId); + final boolean showProgress = message.getBoolean("showProgress"); + handleDocumentStart(tabId, showProgress); } else if ((state & GeckoAppShell.WPL_STATE_STOP) != 0) { Log.i(LOGTAG, "Got a document stop"); handleDocumentStop(tabId); @@ -1181,7 +1182,7 @@ abstract public class GeckoApp }); } - void handleDocumentStart(int tabId) { + void handleDocumentStart(int tabId, final boolean showProgress) { final Tab tab = Tabs.getInstance().getTab(tabId); if (tab == null) return; @@ -1193,7 +1194,8 @@ abstract public class GeckoApp public void run() { if (Tabs.getInstance().isSelectedTab(tab)) { mBrowserToolbar.setSecurityMode(tab.getSecurityMode()); - mBrowserToolbar.setProgressVisibility(true); + if (showProgress) + mBrowserToolbar.setProgressVisibility(true); } onTabsChanged(tab); } diff --git a/mobile/android/chrome/content/browser.js b/mobile/android/chrome/content/browser.js index dbeba52a29b3..91e1ef1cdb0b 100644 --- a/mobile/android/chrome/content/browser.js +++ b/mobile/android/chrome/content/browser.js @@ -426,6 +426,12 @@ var BrowserApp = { let referrerURI = "referrerURI" in aParams ? aParams.referrerURI : null; let charset = "charset" in aParams ? aParams.charset : null; + if ("showProgress" in aParams) { + let tab = this.getTabForBrowser(aBrowser); + if (tab) + tab.showProgress = aParams.showProgress; + } + try { aBrowser.loadURIWithFlags(aURI, flags, referrerURI, charset, postData); } catch(e) { @@ -825,6 +831,11 @@ var BrowserApp = { }; let url = this.getSearchOrFixupURI(data); + + // Don't show progress throbber for about:home + if (url == "about:home") + params.showProgress = false; + if (aTopic == "Tab:Add") this.addTab(url, params); else @@ -1297,6 +1308,7 @@ function Tab(aURL, aParams) { this.browser = null; this.vbox = null; this.id = 0; + this.showProgress = true; this.create(aURL, aParams); this._viewport = { x: 0, y: 0, width: gScreenWidth, height: gScreenHeight, offsetX: 0, offsetY: 0, pageWidth: gScreenWidth, pageHeight: gScreenHeight, zoom: 1.0 }; @@ -1368,6 +1380,9 @@ Tab.prototype = { let referrerURI = "referrerURI" in aParams ? aParams.referrerURI : null; let charset = "charset" in aParams ? aParams.charset : null; + // This determines whether or not we show the progress throbber in the urlbar + this.showProgress = "showProgress" in aParams ? aParams.showProgress : true; + try { this.browser.loadURIWithFlags(aURL, flags, referrerURI, charset, postData); } catch(e) { @@ -1749,11 +1764,14 @@ Tab.prototype = { type: "Content:StateChange", tabID: this.id, uri: uri, - state: aStateFlags + state: aStateFlags, + showProgress: this.showProgress } }; - sendMessageToJava(message); + + // Reset showProgress after state change + this.showProgress = true; } },