| 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. NewTabView manages page list and dot list and handles apps pages | 8 * browsers. NewTabView manages page list and dot list and handles apps pages |
| 9 * callbacks from backend. | 9 * callbacks from backend. |
| 10 * | 10 * |
| (...skipping 684 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 695 if (page.navigationDot) | 695 if (page.navigationDot) |
| 696 page.navigationDot.remove(); | 696 page.navigationDot.remove(); |
| 697 this.cardSlider.removeCard(page); | 697 this.cardSlider.removeCard(page); |
| 698 }, | 698 }, |
| 699 }; | 699 }; |
| 700 | 700 |
| 701 /** | 701 /** |
| 702 * Invoked at startup once the DOM is available to initialize the app. | 702 * Invoked at startup once the DOM is available to initialize the app. |
| 703 */ | 703 */ |
| 704 function onLoad() { | 704 function onLoad() { |
| 705 |
| 706 // TODO(jeremycho): Do not submit. Just for testing. Use |
| 707 // http://codereview.chromium.org/10996064/ once it's submitted. |
| 708 $('show-other-device').onclick = function(e) { |
| 709 chrome.send('showOtherDevice', [e.screenX, e.screenY]); |
| 710 }; |
| 705 // Load the current theme colors. | 711 // Load the current theme colors. |
| 706 themeChanged(); | 712 themeChanged(); |
| 707 | 713 |
| 708 newTabView = new NewTabView(); | 714 newTabView = new NewTabView(); |
| 709 | 715 |
| 710 notificationContainer = getRequiredElement('notification-container'); | 716 notificationContainer = getRequiredElement('notification-container'); |
| 711 notificationContainer.addEventListener( | 717 notificationContainer.addEventListener( |
| 712 'webkitTransitionEnd', onNotificationTransitionEnd); | 718 'webkitTransitionEnd', onNotificationTransitionEnd); |
| 713 | 719 |
| 714 var mostVisited = new ntp.MostVisitedPage(); | 720 var mostVisited = new ntp.MostVisitedPage(); |
| (...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1079 setRecentlyClosedTabs: setRecentlyClosedTabs, | 1085 setRecentlyClosedTabs: setRecentlyClosedTabs, |
| 1080 showNotification: showNotification, | 1086 showNotification: showNotification, |
| 1081 themeChanged: themeChanged, | 1087 themeChanged: themeChanged, |
| 1082 updateLogin: updateLogin, | 1088 updateLogin: updateLogin, |
| 1083 }; | 1089 }; |
| 1084 }); | 1090 }); |
| 1085 | 1091 |
| 1086 document.addEventListener('DOMContentLoaded', ntp.onLoad); | 1092 document.addEventListener('DOMContentLoaded', ntp.onLoad); |
| 1087 | 1093 |
| 1088 var toCssPx = cr.ui.toCssPx; | 1094 var toCssPx = cr.ui.toCssPx; |
| OLD | NEW |