summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorarv@google.com <arv@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-28 18:48:44 +0000
committerarv@google.com <arv@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-28 18:48:44 +0000
commita0ffdc69ed7156fafc7806efc84bae5a6d334b0a (patch)
tree18dcfc39e86bda0479f350147a2860ab272ec1ed
parentbfc0da412fe44af7bd57ae28c21bec4e605246dd (diff)
downloadchromium_src-a0ffdc69ed7156fafc7806efc84bae5a6d334b0a.zip
chromium_src-a0ffdc69ed7156fafc7806efc84bae5a6d334b0a.tar.gz
chromium_src-a0ffdc69ed7156fafc7806efc84bae5a6d334b0a.tar.bz2
When there are no images to replace a blacklisted page, putting filler
causes a blank spot which no other thumbnail can be dragged to. This will go away on page refresh, but we can easily redraw all items keeping the filler in the rightmost indices. Original patch by pierre.lafayette@gmail.com, http://codereview.chromium.org/160152 BUG=17738 r=me git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21869 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--AUTHORS1
-rw-r--r--chrome/browser/resources/new_new_tab.js8
2 files changed, 6 insertions, 3 deletions
diff --git a/AUTHORS b/AUTHORS
index 576a7ab..1054b52 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -45,3 +45,4 @@ Yuri Gorobets <yuri.gorobets@gmail.com>
Paul Wicks <pwicks86@gmail.com>
Thiago Farina <thiago.farina@gmail.com>
Viet-Trung Luu <viettrungluu@gmail.com>
+Pierre-Antoine LaFayette <pierre.lafayette@gmail.com>
diff --git a/chrome/browser/resources/new_new_tab.js b/chrome/browser/resources/new_new_tab.js
index 1707cd5..111f8e8 100644
--- a/chrome/browser/resources/new_new_tab.js
+++ b/chrome/browser/resources/new_new_tab.js
@@ -456,11 +456,13 @@ var mostVisited = {
}
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');