Chromium Code Reviews| Index: chrome/browser/resources/ntp_search/recently_closed_page.js |
| diff --git a/chrome/browser/resources/ntp_search/recently_closed_page.js b/chrome/browser/resources/ntp_search/recently_closed_page.js |
| index a247b0b1c87f6cce219bad52e21205afd6b41af3..b1c40def088d9e193cb8b61068179d62b7ab3ca3 100644 |
| --- a/chrome/browser/resources/ntp_search/recently_closed_page.js |
| +++ b/chrome/browser/resources/ntp_search/recently_closed_page.js |
| @@ -139,26 +139,23 @@ cr.define('ntp', function() { |
| /** |
| * Sets the data that will be used to create Thumbnails. |
| * @param {Array} data The array of data. |
| - * @type (Array} |
| */ |
| - set data(data) { |
| + setData: function(data) { |
| var startTime = Date.now(); |
| - var maxTileCount = this.config_.maxTileCount; |
| - |
| - this.data_ = data.slice(0, maxTileCount); |
| - var dataLength = data.length; |
| - var tileCount = this.tileCount; |
| - // Create new tiles if necessary. |
| - // TODO(jeremycho): Verify this handles the removal of tiles, once that |
| - // functionality is supported. |
| - if (tileCount < dataLength) |
| - this.createTiles_(dataLength - tileCount); |
| - |
| - this.updateTiles_(); |
| + ThumbnailPage.prototype.setData.apply(this, arguments); |
| + |
| // Only show the dot if we have recently closed tabs to display. |
| var dot = this.navigationDot; |
| - if (dot) |
| - dot.hidden = dataLength == 0; |
| + if (this.data_.length == 0) { |
| + dot.hidden = true; |
| + // If the last tab has been removed (by a user click) and we're still on |
| + // the Recently Closed page, fall back to Most Visited. |
|
pedro (no code reviews)
2012/09/05 18:57:00
Most Visited --> first page
It happens to be the
jeremycho
2012/09/05 22:42:11
Done.
|
| + var cardSlider = ntp.getCardSlider(); |
| + if (cardSlider.currentCardValue == this) |
| + cardSlider.selectCard(0, true); |
| + } |
| + else |
| + dot.hidden = false; |
| logEvent('recentlyClosed.layout: ' + (Date.now() - startTime)); |
| } |