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

Unified Diff: chrome/browser/resources/ntp_search/recently_closed_page.js

Issue 10907065: NTP5: Fix page blacklisting and remove recently closed tabs when they're clicked. Fix the styling … (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix bugs. Created 8 years, 3 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
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));
}

Powered by Google App Engine
This is Rietveld 408576698