From 7691d84f679fbbcd01440515d09c253cdbbf8508 Mon Sep 17 00:00:00 2001 From: Mark Capella Date: Mon, 6 Oct 2014 13:38:26 -0400 Subject: [PATCH] Bug 1078231 - Enhance Favicon display in RecentTabs list for closed ReaderMode pages, r=margaret --- mobile/android/base/home/TwoLinePageRow.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/mobile/android/base/home/TwoLinePageRow.java b/mobile/android/base/home/TwoLinePageRow.java index 7434e5c75cb..0b989c43b8f 100644 --- a/mobile/android/base/home/TwoLinePageRow.java +++ b/mobile/android/base/home/TwoLinePageRow.java @@ -7,7 +7,9 @@ package org.mozilla.gecko.home; import java.lang.ref.WeakReference; +import org.mozilla.gecko.AboutPages; import org.mozilla.gecko.R; +import org.mozilla.gecko.ReaderModeUtils; import org.mozilla.gecko.Tab; import org.mozilla.gecko.Tabs; import org.mozilla.gecko.db.BrowserContract.Combined; @@ -248,7 +250,12 @@ public class TwoLinePageRow extends LinearLayout // Blank the Favicon, so we don't show the wrong Favicon if we scroll and miss DB. mFavicon.clearImage(); Favicons.cancelFaviconLoad(mLoadFaviconJobId); - mLoadFaviconJobId = Favicons.getSizedFaviconForPageFromLocal(getContext(), url, mFaviconListener); + + // Displayed RecentTabsPanel urls may refer to pages openned in readermode, so we + // remove the about:reader prefix to ensure the Favicon loads properly. + final String pageURL = AboutPages.isAboutReader(url) ? + ReaderModeUtils.getUrlFromAboutReader(url) : url; + mLoadFaviconJobId = Favicons.getSizedFaviconForPageFromLocal(getContext(), pageURL, mFaviconListener); updateDisplayedUrl(url); }