Adds favicon and thumbnail columns to the chrome://suggestions-internals/ page.

BUG=none
TEST=Visit the chrome://suggestions-internals/ page, and make sure that the favicon and thumbnail columns are present, and that they contain data in at least some cells.

Review URL: https://chromiumcodereview.appspot.com/10382220

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@137716 0039d316-1c4b-4281-b951-d872f2087c98
parent 853220a5
...@@ -88,7 +88,9 @@ cr.define('suggestionsInternals', function() { ...@@ -88,7 +88,9 @@ cr.define('suggestionsInternals', function() {
columns.unshift(columns.splice(index, 1)[0]); columns.unshift(columns.splice(index, 1)[0]);
} }
// Prepend a "Rank" column. // Special columns.
columns.unshift('favicon');
columns.unshift('screenshot');
columns.unshift('rank'); columns.unshift('rank');
// Erase whatever is currently being displayed. // Erase whatever is currently being displayed.
...@@ -127,6 +129,17 @@ cr.define('suggestionsInternals', function() { ...@@ -127,6 +129,17 @@ cr.define('suggestionsInternals', function() {
} }
} else if (column_name == 'rank') { } else if (column_name == 'rank') {
column.innerText = rank++; column.innerText = rank++;
} else if (column_name == 'screenshot') {
var thumbnailUrl = 'chrome://thumb/' + entry.url;
var img = document.createElement('img');
img.onload = function() { column.innerText = 'Y'; }
img.onerror = function() { column.innerText = 'N'; }
img.src = thumbnailUrl;
} else if (column_name == 'favicon') {
var faviconUrl = 'chrome://favicon/size/16/' + entry.url;
column.style.backgroundImage = url(faviconUrl);
column.style.backgroundRepeat = 'no-repeat';
column.style.backgroundPosition = 'center center';
} }
row.appendChild(column); row.appendChild(column);
}); });
......
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