Commit bd99c93d authored by Yuheng Huang's avatar Yuheng Huang Committed by Josip Sokcevic

Fix favicon not showing up on OTR profile

Related CL: https://chromium-review.googlesource.com/c/chromium/src/+/2424510
Bug: 1099917
Change-Id: I9a3272fb1040a002498be4dd876a579804234695
Reviewed-on: https://chrome-internal-review.googlesource.com/c/chrome/browser/resources/tab_search/+/3284531Reviewed-by: default avatarTom Lukaszewicz <tluk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#819611}
parent a2e0fdd7
......@@ -61,9 +61,7 @@
}
</style>
<div class="favicon"
style="background-image:[[faviconUrl_(data.isDefaultFavicon, data.url)]]">
</div>
<div class="favicon" style="background-image:[[faviconUrl_(data)]]"></div>
<div class="text-container">
<div id="primaryText"></div>
<div id="secondaryText"></div>
......
......@@ -44,14 +44,13 @@ export class TabSearchItem extends PolymerElement {
}
/**
* @param {boolean} isDefaultFavicon
* @param {string} url
* @param {!tabSearch.mojom.Tab} data
* @return {string}
* @private
*/
faviconUrl_(isDefaultFavicon, url) {
return getFaviconForPageURL(
isDefaultFavicon ? 'chrome://newtab' : url, false);
faviconUrl_(data) {
return data.faviconUrl ? `url("${data.faviconUrl}")` :
getFaviconForPageURL(data.isDefaultFavicon ? 'chrome://newtab' : data.url, false);
}
/**
......
......@@ -85,7 +85,6 @@ suite('TabSearchAppTest', () => {
const tabData = {
index: 0,
tabId: 1,
favIconUrl: '',
title: 'Google',
url: 'https://www.google.com',
};
......@@ -204,7 +203,6 @@ suite('TabSearchAppTest', () => {
const updatedTab = /** @type {!tabSearch.mojom.Tab} */ ({
index: 0,
tabId: 1,
favIconUrl: '',
title: 'Example',
url: 'https://example.com',
lastActiveTimeTicks: { internalValue: 1 },
......@@ -335,7 +333,6 @@ suite('TabSearchAppTest', () => {
{
index: 0,
tabId: 1,
favIconUrl: '',
title: 'Google',
url: 'https://www.google.com',
lastActiveTimeTicks: { internalValue: 2 },
......@@ -343,7 +340,6 @@ suite('TabSearchAppTest', () => {
{
index: 1,
tabId: 2,
favIconUrl: '',
title: 'Bing',
url: 'https://www.bing.com',
lastActiveTimeTicks: { internalValue: 4 },
......@@ -351,7 +347,6 @@ suite('TabSearchAppTest', () => {
{
index: 2,
tabId: 3,
favIconUrl: '',
title: 'Yahoo',
url: 'https://www.yahoo.com',
lastActiveTimeTicks: { internalValue: 3 },
......
......@@ -11,21 +11,18 @@ export function sampleData() {
{
index: 0,
tabId: 1,
favIconUrl: '',
title: 'Google',
url: 'https://www.google.com',
},
{
index: 1,
tabId: 5,
favIconUrl: '',
title: 'Amazon',
url: 'https://www.amazon.com',
},
{
index: 2,
tabId: 6,
favIconUrl: '',
title: 'Apple',
url: 'https://www.apple.com',
}
......@@ -37,21 +34,18 @@ export function sampleData() {
{
index: 0,
tabId: 2,
favIconUrl: '',
title: 'Bing',
url: 'https://www.bing.com/',
},
{
index: 1,
tabId: 3,
favIconUrl: '',
title: 'Yahoo',
url: 'https://www.yahoo.com',
},
{
index: 2,
tabId: 4,
favIconUrl: '',
title: 'Apple',
url: 'https://www.apple.com/',
},
......
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