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

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

Issue 160152: When there are no images to replace a blacklisted page, putting filler... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 11 years, 5 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 | « AUTHORS ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/new_new_tab.js
===================================================================
--- chrome/browser/resources/new_new_tab.js (revision 21628)
+++ chrome/browser/resources/new_new_tab.js (working copy)
@@ -456,11 +456,13 @@
}
if (!newItem) {
- newItem = {filler: true};
+ // If no other page is available to replace the blacklisted item,
+ // we need to reorder items s.t. all filler items are in the rightmost
+ // indices.
+ mostVisitedPages(data);
}
-
// Replace old item with new item in the mostVisitedData array.
- if (oldIndex != -1) {
+ else if (oldIndex != -1) {
mostVisitedData.splice(oldIndex, 1, newItem);
mostVisitedPages(mostVisitedData);
addClass(el, 'fade-in');
« no previous file with comments | « AUTHORS ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698