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

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: Sync and rebase 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
« no previous file with comments | « chrome/browser/resources/ntp_search/thumbnail_page.css ('k') | chrome/browser/ui/search/search_ui.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..b9ac8b4208abdeb212aef2322834ab73f347558c 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');
+ 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);
« no previous file with comments | « chrome/browser/resources/ntp_search/thumbnail_page.css ('k') | chrome/browser/ui/search/search_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698