From f5bc58a6a578647a63d071d418122c6bcdef2740 Mon Sep 17 00:00:00 2001 From: Vlad Tanase Date: Wed, 19 Mar 2014 16:08:05 +0200 Subject: [PATCH] Bug 983475 - Remove shouldShowProgress method from browser.js. r=bnicholson --- mobile/android/base/Tab.java | 4 ++-- mobile/android/base/Tabs.java | 4 ++-- mobile/android/chrome/content/browser.js | 9 ++------- 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/mobile/android/base/Tab.java b/mobile/android/base/Tab.java index 6f70e6905838..a0d6311ff2c7 100644 --- a/mobile/android/base/Tab.java +++ b/mobile/android/base/Tab.java @@ -644,9 +644,9 @@ public class Tab { return !AboutPages.isAboutPage(url); } - void handleDocumentStart(boolean showProgress, String url) { + void handleDocumentStart(boolean restoring, String url) { setLoadProgress(LOAD_PROGRESS_START); - setState(showProgress ? STATE_LOADING : STATE_SUCCESS); + setState((!restoring && shouldShowProgress(url)) ? STATE_LOADING : STATE_SUCCESS); updateIdentityData(null); setReaderEnabled(false); } diff --git a/mobile/android/base/Tabs.java b/mobile/android/base/Tabs.java index d4110816fc05..7f6c3cdb4a05 100644 --- a/mobile/android/base/Tabs.java +++ b/mobile/android/base/Tabs.java @@ -446,8 +446,8 @@ public class Tabs implements GeckoEventListener { int state = message.getInt("state"); if ((state & GeckoAppShell.WPL_STATE_IS_NETWORK) != 0) { if ((state & GeckoAppShell.WPL_STATE_START) != 0) { - boolean showProgress = message.getBoolean("showProgress"); - tab.handleDocumentStart(showProgress, message.getString("uri")); + boolean restoring = message.getBoolean("restoring"); + tab.handleDocumentStart(restoring, message.getString("uri")); notifyListeners(tab, Tabs.TabEvents.START); } else if ((state & GeckoAppShell.WPL_STATE_STOP) != 0) { tab.handleDocumentStop(message.getBoolean("success")); diff --git a/mobile/android/chrome/content/browser.js b/mobile/android/chrome/content/browser.js index 7d99721e10e2..97800a2cf231 100644 --- a/mobile/android/chrome/content/browser.js +++ b/mobile/android/chrome/content/browser.js @@ -241,10 +241,6 @@ function resolveGeckoURI(aURI) { return aURI; } -function shouldShowProgress(url) { - return !url.startsWith("about:"); -} - /** * Cache of commonly used string bundles. */ @@ -3882,15 +3878,14 @@ Tab.prototype = { // Check to see if we restoring the content from a previous presentation (session) // since there should be no real network activity - let restoring = aStateFlags & Ci.nsIWebProgressListener.STATE_RESTORING; - let showProgress = restoring ? false : shouldShowProgress(uri); + let restoring = (aStateFlags & Ci.nsIWebProgressListener.STATE_RESTORING) > 0; let message = { type: "Content:StateChange", tabID: this.id, uri: uri, state: aStateFlags, - showProgress: showProgress, + restoring: restoring, success: success }; sendMessageToJava(message);