OLD | NEW |
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 var TilePage = ntp.TilePage; | 8 var TilePage = ntp.TilePage; |
9 | 9 |
10 /** | 10 /** |
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
363 * Most Visited pane). | 363 * Most Visited pane). |
364 * @param {Event} e The CardChanged event. | 364 * @param {Event} e The CardChanged event. |
365 */ | 365 */ |
366 handleCardSelected_: function(e) { | 366 handleCardSelected_: function(e) { |
367 if (!document.documentElement.classList.contains('starting-up')) | 367 if (!document.documentElement.classList.contains('starting-up')) |
368 chrome.send('mostVisitedSelected'); | 368 chrome.send('mostVisitedSelected'); |
369 }, | 369 }, |
370 | 370 |
371 /** | 371 /** |
372 * Array of most visited data objects. | 372 * Array of most visited data objects. |
373 * @type {Array.<PageData>} | 373 * @type {Array<PageData>} |
374 */ | 374 */ |
375 get data() { | 375 get data() { |
376 return this.data_; | 376 return this.data_; |
377 }, | 377 }, |
378 set data(data) { | 378 set data(data) { |
379 var startTime = Date.now(); | 379 var startTime = Date.now(); |
380 | 380 |
381 // The first time data is set, create the tiles. | 381 // The first time data is set, create the tiles. |
382 if (!this.data_) { | 382 if (!this.data_) { |
383 this.createTiles_(); | 383 this.createTiles_(); |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
486 return oldData; | 486 return oldData; |
487 }; | 487 }; |
488 | 488 |
489 return { | 489 return { |
490 MostVisitedPage: MostVisitedPage, | 490 MostVisitedPage: MostVisitedPage, |
491 refreshData: refreshData, | 491 refreshData: refreshData, |
492 }; | 492 }; |
493 }); | 493 }); |
494 | 494 |
495 document.addEventListener('ntpLoaded', ntp.MostVisitedPage.onLoaded); | 495 document.addEventListener('ntpLoaded', ntp.MostVisitedPage.onLoaded); |
OLD | NEW |