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

Unified Diff: chrome/browser/resources/ntp_search/thumbnail_page.js

Issue 11416091: NTP5: Implementing new specification for favicons of Most Visited Pages. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month 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
Index: chrome/browser/resources/ntp_search/thumbnail_page.js
diff --git a/chrome/browser/resources/ntp_search/thumbnail_page.js b/chrome/browser/resources/ntp_search/thumbnail_page.js
index 900ec8333502df9dca071fe82975724deb2ac2db..0f76bcabef97175b51dab7557a72453a4e46d2b6 100644
--- a/chrome/browser/resources/ntp_search/thumbnail_page.js
+++ b/chrome/browser/resources/ntp_search/thumbnail_page.js
@@ -85,9 +85,12 @@ cr.define('ntp', function() {
if (banner)
thumbnailImage.removeChild(banner);
- var favicon = thumbnailImage.querySelector('.thumbnail-favicon');
- if (favicon)
- thumbnailImage.removeChild(favicon);
+ var favicon = this.querySelector('.thumbnail-favicon') ||
+ this.ownerDocument.createElement('div');
Evan Stade 2012/11/20 20:05:00 var favicon = this.querySelector('.thumbnail-favic
pedro (no code reviews) 2012/11/20 20:14:00 Done.
+ favicon.className = 'thumbnail-favicon';
+ favicon.style.backgroundImage =
+ url('chrome://favicon/size/16/' + dataUrl);
+ this.appendChild(favicon);
var self = this;
var image = new Image();
@@ -103,13 +106,6 @@ cr.define('ntp', function() {
// TODO(jeremycho): Consult with UX on URL truncation.
banner.textContent = dataUrl.replace(/^(http:\/\/)?(www\.)?|\/$/gi, '');
thumbnailImage.appendChild(banner);
-
- favicon = thumbnailImage.querySelector('.thumbnail-favicon') ||
- self.ownerDocument.createElement('div');
- favicon.className = 'thumbnail-favicon';
- favicon.style.backgroundImage =
- url('chrome://favicon/size/16/' + dataUrl);
- thumbnailImage.appendChild(favicon);
};
var thumbnailUrl = ntp.getThumbnailUrl(dataUrl);

Powered by Google App Engine
This is Rietveld 408576698