Bug 718846 - Don't show progress throbber on about:home. r=mfinkle

This commit is contained in:
Margaret Leibovic 2012-01-19 11:44:16 -08:00
parent e21f1bcba1
commit 2838e032cf
2 changed files with 25 additions and 5 deletions

View File

@ -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);
}

View File

@ -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;
}
},