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

Side by Side Diff: chrome/browser/resources/ntp_search/tile_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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/resources/ntp_search/thumbnail_page.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 cr.define('ntp', function() { 5 cr.define('ntp', function() {
6 'use strict'; 6 'use strict';
7 7
8 //---------------------------------------------------------------------------- 8 //----------------------------------------------------------------------------
9 // Constants 9 // Constants
10 //---------------------------------------------------------------------------- 10 //----------------------------------------------------------------------------
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 /** 298 /**
299 * Whether or not this TilePage is selected. 299 * Whether or not this TilePage is selected.
300 * @type {boolean} 300 * @type {boolean}
301 */ 301 */
302 get selected() { 302 get selected() {
303 return Array.prototype.indexOf.call(this.parentNode.children, this) == 303 return Array.prototype.indexOf.call(this.parentNode.children, this) ==
304 ntp.getCardSlider().currentCard; 304 ntp.getCardSlider().currentCard;
305 }, 305 },
306 306
307 /** 307 /**
308 * The notification content of this tile (if any, otherwise null).
309 * @type {!HTMLElement}
310 */
311 get notification() {
312 return this.content_.firstChild.id == 'notification-container' ?
313 this.content_.firstChild : null;
314 },
315 /**
316 * The notification content of this tile (if any, otherwise null).
317 * @type {!HTMLElement}
318 */
319 set notification(node) {
320 assert(node instanceof HTMLElement, '|node| isn\'t an HTMLElement!');
321 // NOTE: Implicitly removes from DOM if |node| is inside it.
322 this.content_.insertBefore(node, this.content_.firstChild);
323 this.positionNotification_();
324 },
325
326 /**
327 * Removes the tilePage from the DOM and cleans up event handlers. 308 * Removes the tilePage from the DOM and cleans up event handlers.
328 */ 309 */
329 remove: function() { 310 remove: function() {
330 // This checks arguments.length as most remove functions have a boolean 311 // This checks arguments.length as most remove functions have a boolean
331 // |opt_animate| argument, but that's not necesarilly applicable to 312 // |opt_animate| argument, but that's not necesarilly applicable to
332 // removing a tilePage. Selecting a different card in an animated way and 313 // removing a tilePage. Selecting a different card in an animated way and
333 // deleting the card afterward is probably a better choice. 314 // deleting the card afterward is probably a better choice.
334 assert(typeof arguments[0] != 'boolean', 315 assert(typeof arguments[0] != 'boolean',
335 'This function takes no |opt_animate| argument.'); 316 'This function takes no |opt_animate| argument.');
336 this.tearDown_(); 317 this.tearDown_();
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
414 }, 395 },
415 396
416 /** 397 /**
417 * Called when the page loses selection (in the card selector). 398 * Called when the page loses selection (in the card selector).
418 * @param {Event} e A custom carddeselected event. 399 * @param {Event} e A custom carddeselected event.
419 * @private 400 * @private
420 */ 401 */
421 handleCardDeselection_: function(e) { 402 handleCardDeselection_: function(e) {
422 }, 403 },
423 404
424 /**
425 * Position the notification if there's one showing.
426 * TODO(pedrosimonetti): Fix the position of the notification.
427 */
428 positionNotification_: function() {
429 },
430
431 // ######################################################################### 405 // #########################################################################
432 // Extended Chrome Instant 406 // Extended Chrome Instant
433 // ######################################################################### 407 // #########################################################################
434 408
435 409
436 // properties 410 // properties
437 // ------------------------------------------------------------------------- 411 // -------------------------------------------------------------------------
438 412
439 // The number of columns. 413 // The number of columns.
440 colCount_: 0, 414 colCount_: 0,
(...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after
898 } 872 }
899 873
900 return { 874 return {
901 // TODO(pedrosimonetti): Drag. Delete after porting the rest of the code. 875 // TODO(pedrosimonetti): Drag. Delete after porting the rest of the code.
902 getCurrentlyDraggingTile2: deprecate, 876 getCurrentlyDraggingTile2: deprecate,
903 setCurrentDropEffect2: deprecate, 877 setCurrentDropEffect2: deprecate,
904 Tile2: Tile, 878 Tile2: Tile,
905 TilePage2: TilePage 879 TilePage2: TilePage
906 }; 880 };
907 }); 881 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/ntp_search/thumbnail_page.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698