diff options
author | arv@google.com <arv@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-04 02:08:56 +0000 |
---|---|---|
committer | arv@google.com <arv@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-04 02:08:56 +0000 |
commit | df84851d7cbe3594d264ad705400739fac85edcd (patch) | |
tree | b42e2707ced78045d114f6163bb5d3a2e9b3df61 /chrome/browser/resources | |
parent | 2c1867e56d585a47d3baf7485d832f357d4d5077 (diff) | |
download | chromium_src-df84851d7cbe3594d264ad705400739fac85edcd.zip chromium_src-df84851d7cbe3594d264ad705400739fac85edcd.tar.gz chromium_src-df84851d7cbe3594d264ad705400739fac85edcd.tar.bz2 |
NNTP: Fix issue with pinning the pre-populated thumbnails.
BUG=20801
TEST=Create a new profile and open the new tab page. Pin and reorder the
pre-populated thumbnails. The thumbnails and favicons should continue to
work.
Review URL: http://codereview.chromium.org/195010
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25422 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/resources')
-rw-r--r-- | chrome/browser/resources/new_new_tab.js | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/chrome/browser/resources/new_new_tab.js b/chrome/browser/resources/new_new_tab.js index d960b79..0877f97 100644 --- a/chrome/browser/resources/new_new_tab.js +++ b/chrome/browser/resources/new_new_tab.js @@ -357,6 +357,10 @@ function hideSection(section) { } var mostVisited = { + addPinnedUrl_: function(data, index) { + chrome.send('addPinnedURL', [data.url, data.title, data.faviconUrl || '', + data.thumbnailUrl || '', String(index)]); + }, getItem: function(el) { return findAncestorByClass(el, 'thumbnail-container'); }, @@ -370,7 +374,7 @@ var mostVisited = { var data = mostVisitedData[index]; data.pinned = !data.pinned; if (data.pinned) { - chrome.send('addPinnedURL', [data.url, data.title, String(index)]); + this.addPinnedUrl_(data, index); } else { chrome.send('removePinnedURL', [data.url]); } @@ -399,16 +403,14 @@ var mostVisited = { swapDomNodes(source, destination); var sourceData = mostVisitedData[sourceIndex]; - chrome.send('addPinnedURL', [sourceData.url, sourceData.title, - String(destinationIndex)]); + this.addPinnedUrl_(sourceData, destinationIndex); sourceData.pinned = true; this.updatePinnedDom_(source, true); var destinationData = mostVisitedData[destinationIndex]; // Only update the destination if it was pinned before. if (destinationData.pinned) { - chrome.send('addPinnedURL', [destinationData.url, destinationData.title, - String(sourceIndex)]); + this.addPinnedUrl_(destinationData, sourceIndex); } mostVisitedData[destinationIndex] = sourceData; mostVisitedData[sourceIndex] = destinationData; @@ -467,7 +469,7 @@ var mostVisited = { showNotification('', actionText, function() { self.removeFromBlackList(url); if (wasPinned) { - chromeSend('addPinnedURL', [url, oldItem.title, String(oldIndex)]); + self.addPinnedUrl_(oldItem, oldIndex); } chrome.send('getMostVisited'); }); |