Bug 1035131 - User decoded user entered URLs in suggeste image lookups (r=mfinkle)

This commit is contained in:
Lucas Rocha 2014-07-07 15:59:53 +01:00
parent 4d4b03e37f
commit 8333c2f43c

View File

@ -555,11 +555,14 @@ public class TopSitesPanel extends HomeFragment {
return;
}
// Make sure we query suggested images without the user-entered wrapper.
final String decodedUrl = StringUtils.decodeUserEnteredUrl(url);
// Suggested images have precedence over thumbnails, no need to wait
// for them to be loaded. See: CursorLoaderCallbacks.onLoadFinished()
final String imageUrl = BrowserDB.getSuggestedImageUrlForUrl(url);
final String imageUrl = BrowserDB.getSuggestedImageUrlForUrl(decodedUrl);
if (!TextUtils.isEmpty(imageUrl)) {
final int bgColor = BrowserDB.getSuggestedBackgroundColorForUrl(url);
final int bgColor = BrowserDB.getSuggestedBackgroundColorForUrl(decodedUrl);
view.displayThumbnail(imageUrl, bgColor);
return;
}