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

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: Rebase and respond to Evan's comments. 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..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));
}
« no previous file with comments | « chrome/browser/resources/ntp_search/new_tab.js ('k') | chrome/browser/resources/ntp_search/thumbnail_page.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698