diff --git a/mobile/android/base/GeckoApp.java b/mobile/android/base/GeckoApp.java index de91e35bb33..697ef0a28e2 100644 --- a/mobile/android/base/GeckoApp.java +++ b/mobile/android/base/GeckoApp.java @@ -1086,7 +1086,7 @@ abstract public class GeckoApp if (tab == null) return; - tab.setState("about:home".equals(uri) ? Tab.STATE_SUCCESS : Tab.STATE_LOADING); + tab.setState(shouldShowProgress(uri) ? Tab.STATE_SUCCESS : Tab.STATE_LOADING); tab.updateIdentityData(null); tab.setReaderEnabled(false); if (Tabs.getInstance().isSelectedTab(tab)) @@ -2672,6 +2672,10 @@ abstract public class GeckoApp return false; } + public static boolean shouldShowProgress(String url) { + return "about:home".equals(url) || ReaderModeUtils.isAboutReader(url); + } + public static void assertOnUiThread() { Thread uiThread = mAppContext.getMainLooper().getThread(); assertOnThread(uiThread); diff --git a/mobile/android/base/ReaderModeUtils.java b/mobile/android/base/ReaderModeUtils.java index b3e81ba1880..599a9fa268e 100644 --- a/mobile/android/base/ReaderModeUtils.java +++ b/mobile/android/base/ReaderModeUtils.java @@ -5,10 +5,18 @@ package org.mozilla.gecko; import android.net.Uri; +import android.text.TextUtils; public class ReaderModeUtils { private static final String LOGTAG = "ReaderModeUtils"; + public static boolean isAboutReader(String url) { + if (url == null) + return false; + + return url.startsWith("about:reader"); + } + public static String getAboutReaderForUrl(String url, boolean inReadingList) { return getAboutReaderForUrl(url, -1, inReadingList); } diff --git a/mobile/android/base/Tab.java b/mobile/android/base/Tab.java index 50ca101907c..51f3592b0dd 100644 --- a/mobile/android/base/Tab.java +++ b/mobile/android/base/Tab.java @@ -94,7 +94,7 @@ public final class Tab { mZoomConstraints = new ZoomConstraints(false); mPluginViews = new ArrayList(); mPluginLayers = new HashMap(); - mState = "about:home".equals(url) ? STATE_SUCCESS : STATE_LOADING; + mState = GeckoApp.shouldShowProgress(url) ? STATE_SUCCESS : STATE_LOADING; mContentResolver = Tabs.getInstance().getContentResolver(); mContentObserver = new ContentObserver(GeckoAppShell.getHandler()) { public void onChange(boolean selfChange) { diff --git a/mobile/android/chrome/content/browser.js b/mobile/android/chrome/content/browser.js index 061aa896c47..cb6747a2da8 100644 --- a/mobile/android/chrome/content/browser.js +++ b/mobile/android/chrome/content/browser.js @@ -117,6 +117,10 @@ function resolveGeckoURI(aURI) { return aURI; } +function shouldShowProgress(url) { + return (url != "about:home" && !/^about:reader/.test(url)); +} + /** * Cache of commonly used string bundles. */ @@ -311,7 +315,7 @@ var BrowserApp = { // Start the restore ss.restoreLastSession(restoreToFront, restoreMode == 1); } else { - loadParams.showProgress = (url != "about:home"); + loadParams.showProgress = shouldShowProgress(url); loadParams.pinned = pinned; this.addTab(url, loadParams); @@ -1056,8 +1060,8 @@ var BrowserApp = { } } - // Don't show progress throbber for about:home - if (url == "about:home") + // Don't show progress throbber for about:home or about:reader + if (!shouldShowProgress(url)) params.showProgress = false; if (aTopic == "Tab:Add")