Bug 931843 - Part 3: don't retain thumbnails. r=bnicholson

This commit is contained in:
Richard Newman 2013-11-04 11:48:58 -08:00
Родитель 6983a6c01c
Коммит 2dae3effaa
2 изменённых файлов: 5 добавлений и 12 удалений

Просмотреть файл

@ -43,7 +43,7 @@ public class TopSitesGridItemView extends RelativeLayout {
private String mUrl;
private String mFaviconURL;
private Bitmap mThumbnail;
private boolean mThumbnailSet;
// Pinned state.
private boolean mIsPinned = false;
@ -170,7 +170,7 @@ public class TopSitesGridItemView extends RelativeLayout {
} else if (changed) {
// Because we'll have a new favicon or thumbnail arriving shortly, and
// we need to not reject it because we already had a thumbnail.
mThumbnail = null;
mThumbnailSet = false;
}
if (changed) {
@ -196,6 +196,7 @@ public class TopSitesGridItemView extends RelativeLayout {
mThumbnailView.setScaleType(SCALE_TYPE_RESOURCE);
mThumbnailView.setImageResource(resId);
mThumbnailView.setBackgroundColor(0x0);
mThumbnailSet = false;
}
/**
@ -209,7 +210,7 @@ public class TopSitesGridItemView extends RelativeLayout {
displayThumbnail(R.drawable.favicon);
return;
}
mThumbnail = thumbnail;
mThumbnailSet = true;
Favicons.cancelFaviconLoad(mLoadId);
mThumbnailView.setScaleType(SCALE_TYPE_THUMBNAIL);
@ -234,7 +235,7 @@ public class TopSitesGridItemView extends RelativeLayout {
* @param favicon The favicon to show as thumbnail.
*/
public void displayFavicon(Bitmap favicon, String faviconURL) {
if (mThumbnail != null) {
if (mThumbnailSet) {
// Already showing a thumbnail; do nothing.
return;
}

Просмотреть файл

@ -141,14 +141,6 @@ public class TwoLinePageRow extends LinearLayout
mUrl.setCompoundDrawablesWithIntrinsicBounds(mUrlIconId, 0, mBookmarkIconId, 0);
}
private void setFaviconWithUrl(Bitmap favicon, String url) {
if (favicon == null) {
mFavicon.showDefaultFavicon();
} else {
mFavicon.updateImage(favicon, url);
}
}
private void setBookmarkIcon(int bookmarkIconId) {
if (mBookmarkIconId == bookmarkIconId) {
return;