Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5715)

Unified Diff: chrome/browser/resources/suggestions_internals/suggestions_internals.js

Issue 10382220: Adds favicon and thumbnail columns to the chrome://suggestions-internals/ page. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/suggestions_internals/suggestions_internals.js
===================================================================
--- chrome/browser/resources/suggestions_internals/suggestions_internals.js (revision 137650)
+++ chrome/browser/resources/suggestions_internals/suggestions_internals.js (working copy)
@@ -88,7 +88,9 @@
columns.unshift(columns.splice(index, 1)[0]);
}
- // Prepend a "Rank" column.
+ // Special columns.
+ columns.unshift('favicon');
+ columns.unshift('screenshot');
columns.unshift('rank');
// Erase whatever is currently being displayed.
@@ -127,6 +129,17 @@
}
} else if (column_name == '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);
});
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698