Commit c5d49e90 authored by John Lee's avatar John Lee Committed by Commit Bot

WebUI: Add fallback for search engine favicons

This CL adds a default fallback of a favicon with an empty URL to
display the default globe icon, and also sends the search engine URL
as a fallback if the search engine favicon URL is not available.

Bug: 1002840
Change-Id: Ie1662e5b3c0e95418abc9bb4bf9a5306f15668d6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1798982Reviewed-by: default avatarEsmael Elmoslimany <aee@chromium.org>
Commit-Queue: John Lee <johntlee@chromium.org>
Cr-Commit-Position: refs/heads/master@{#695850}
parent 2bacefe0
...@@ -42,7 +42,10 @@ ...@@ -42,7 +42,10 @@
<div class="list-item" focus-row-container> <div class="list-item" focus-row-container>
<div id="name-column"> <div id="name-column">
<site-favicon favicon-url="[[engine.iconURL]]"></site-favicon> <site-favicon
favicon-url="[[engine.iconURL]]"
url="[[engine.url]]">
</site-favicon>
<div>[[engine.displayName]]</div> <div>[[engine.displayName]]</div>
</div> </div>
<div id="keyword-column"><div>[[engine.keyword]]</div></div> <div id="keyword-column"><div>[[engine.keyword]]</div></div>
......
...@@ -17,7 +17,7 @@ Polymer({ ...@@ -17,7 +17,7 @@ Polymer({
/** @private */ /** @private */
getBackgroundImage_: function() { getBackgroundImage_: function() {
let backgroundImage = 'none'; let backgroundImage = cr.icon.getFavicon('');
if (this.faviconUrl) { if (this.faviconUrl) {
const url = this.ensureUrlHasScheme_(this.faviconUrl); const url = this.ensureUrlHasScheme_(this.faviconUrl);
backgroundImage = cr.icon.getFavicon(url); backgroundImage = cr.icon.getFavicon(url);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment