| 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..997ef1f5426e2427961f67ab92b605c439454d05 100644
|
| --- a/chrome/browser/resources/ntp_search/recently_closed_page.js
|
| +++ b/chrome/browser/resources/ntp_search/recently_closed_page.js
|
| @@ -139,26 +139,24 @@ 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 the first page in the dot
|
| + // list.
|
| + var cardSlider = ntp.getCardSlider();
|
| + if (cardSlider.currentCardValue == this)
|
| + cardSlider.selectCard(0, true);
|
| + } else {
|
| + dot.hidden = false;
|
| + }
|
|
|
| logEvent('recentlyClosed.layout: ' + (Date.now() - startTime));
|
| }
|
|
|