| 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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 */ | 115 */ |
| 116 function onLoad() { | 116 function onLoad() { |
| 117 sectionsToWaitFor = 0; | 117 sectionsToWaitFor = 0; |
| 118 if (loadTimeData.getBoolean('showMostvisited')) | 118 if (loadTimeData.getBoolean('showMostvisited')) |
| 119 sectionsToWaitFor++; | 119 sectionsToWaitFor++; |
| 120 if (loadTimeData.getBoolean('showApps')) { | 120 if (loadTimeData.getBoolean('showApps')) { |
| 121 sectionsToWaitFor++; | 121 sectionsToWaitFor++; |
| 122 if (loadTimeData.getBoolean('showAppLauncherPromo')) { | 122 if (loadTimeData.getBoolean('showAppLauncherPromo')) { |
| 123 $('app-launcher-promo-close-button').addEventListener('click', | 123 $('app-launcher-promo-close-button').addEventListener('click', |
| 124 function() { chrome.send('stopShowingAppLauncherPromo'); }); | 124 function() { chrome.send('stopShowingAppLauncherPromo'); }); |
| 125 $('apps-promo-learn-more').addEventListener('click', |
| 126 function() { chrome.send('onLearnMore'); }); |
| 125 } | 127 } |
| 126 } | 128 } |
| 127 if (loadTimeData.getBoolean('isDiscoveryInNTPEnabled')) | 129 if (loadTimeData.getBoolean('isDiscoveryInNTPEnabled')) |
| 128 sectionsToWaitFor++; | 130 sectionsToWaitFor++; |
| 129 measureNavDots(); | 131 measureNavDots(); |
| 130 | 132 |
| 131 // Load the current theme colors. | 133 // Load the current theme colors. |
| 132 themeChanged(); | 134 themeChanged(); |
| 133 | 135 |
| 134 newTabView = new NewTabView(); | 136 newTabView = new NewTabView(); |
| (...skipping 558 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 693 setFaviconDominantColor: setFaviconDominantColor, | 695 setFaviconDominantColor: setFaviconDominantColor, |
| 694 showNotification: showNotification, | 696 showNotification: showNotification, |
| 695 themeChanged: themeChanged, | 697 themeChanged: themeChanged, |
| 696 updateLogin: updateLogin | 698 updateLogin: updateLogin |
| 697 }; | 699 }; |
| 698 }); | 700 }); |
| 699 | 701 |
| 700 document.addEventListener('DOMContentLoaded', ntp.onLoad); | 702 document.addEventListener('DOMContentLoaded', ntp.onLoad); |
| 701 | 703 |
| 702 var toCssPx = cr.ui.toCssPx; | 704 var toCssPx = cr.ui.toCssPx; |
| OLD | NEW |