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 /** | 5 /** |
6 * @fileoverview New tab page | 6 * @fileoverview New tab page |
7 * This is the main code for the new tab page used by touch-enabled Chrome | 7 * This is the main code for the new tab page used by touch-enabled Chrome |
8 * browsers. For now this is still a prototype. | 8 * browsers. For now this is still a prototype. |
9 */ | 9 */ |
10 | 10 |
(...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
387 * When done fading out, set hidden to true so the notification can't be | 387 * When done fading out, set hidden to true so the notification can't be |
388 * tabbed to or clicked. | 388 * tabbed to or clicked. |
389 * @param {Event} e The webkitTransitionEnd event. | 389 * @param {Event} e The webkitTransitionEnd event. |
390 */ | 390 */ |
391 function onNotificationTransitionEnd(e) { | 391 function onNotificationTransitionEnd(e) { |
392 if (notificationContainer.classList.contains('inactive')) | 392 if (notificationContainer.classList.contains('inactive')) |
393 notificationContainer.hidden = true; | 393 notificationContainer.hidden = true; |
394 } | 394 } |
395 | 395 |
396 function setRecentlyClosedTabs(data) { | 396 function setRecentlyClosedTabs(data) { |
397 newTabView.recentlyClosedPage.data = data; | 397 newTabView.recentlyClosedPage.setData(data); |
398 } | 398 } |
399 | 399 |
400 function setMostVisitedPages(data, hasBlacklistedUrls) { | 400 function setMostVisitedPages(data, hasBlacklistedUrls) { |
401 newTabView.mostVisitedPage.data = data; | 401 newTabView.mostVisitedPage.setData(data); |
402 cr.dispatchSimpleEvent(document, 'sectionready', true, true); | 402 cr.dispatchSimpleEvent(document, 'sectionready', true, true); |
403 } | 403 } |
404 | 404 |
405 function setSuggestionsPages(data, hasBlacklistedUrls) { | 405 function setSuggestionsPages(data, hasBlacklistedUrls) { |
406 newTabView.suggestionsPage.data = data; | 406 newTabView.suggestionsPage.data = data; |
407 } | 407 } |
408 | 408 |
409 function getThumbnailUrl(url) { | 409 function getThumbnailUrl(url) { |
410 return 'chrome://thumb/' + url; | 410 return 'chrome://thumb/' + url; |
411 } | 411 } |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
523 setRecentlyClosedTabs: setRecentlyClosedTabs, | 523 setRecentlyClosedTabs: setRecentlyClosedTabs, |
524 showNotification: showNotification, | 524 showNotification: showNotification, |
525 themeChanged: themeChanged, | 525 themeChanged: themeChanged, |
526 updateLogin: updateLogin | 526 updateLogin: updateLogin |
527 }; | 527 }; |
528 }); | 528 }); |
529 | 529 |
530 document.addEventListener('DOMContentLoaded', ntp.onLoad); | 530 document.addEventListener('DOMContentLoaded', ntp.onLoad); |
531 | 531 |
532 var toCssPx = cr.ui.toCssPx; | 532 var toCssPx = cr.ui.toCssPx; |
OLD | NEW |