| 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 4 | 6 * @fileoverview New tab page 4 |
| 7 * This is the main code for a previous version of the Chrome NTP ("NTP4"). | 7 * This is the main code for a previous version of the Chrome NTP ("NTP4"). |
| 8 * Some parts of this are still used for the chrome://apps page. | 8 * Some parts of this are still used for the chrome://apps page. |
| 9 */ | 9 */ |
| 10 | 10 |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 | 72 |
| 73 // TODO(dbeam): NewTabView is now the only extender of PageListView; these | 73 // TODO(dbeam): NewTabView is now the only extender of PageListView; these |
| 74 // classes should be merged. | 74 // classes should be merged. |
| 75 NewTabView.prototype = {__proto__: ntp.PageListView.prototype}; | 75 NewTabView.prototype = {__proto__: ntp.PageListView.prototype}; |
| 76 | 76 |
| 77 /** | 77 /** |
| 78 * Invoked at startup once the DOM is available to initialize the app. | 78 * Invoked at startup once the DOM is available to initialize the app. |
| 79 */ | 79 */ |
| 80 function onLoad() { | 80 function onLoad() { |
| 81 sectionsToWaitFor = 0; | 81 sectionsToWaitFor = 0; |
| 82 if (loadTimeData.getBoolean('showApps')) { | 82 if (loadTimeData.getBoolean('showApps')) |
| 83 sectionsToWaitFor++; | 83 sectionsToWaitFor++; |
| 84 if (loadTimeData.getBoolean('showAppLauncherPromo')) { | 84 |
| 85 $('app-launcher-promo-close-button').addEventListener('click', | |
| 86 function() { chrome.send('stopShowingAppLauncherPromo'); }); | |
| 87 $('apps-promo-learn-more').addEventListener('click', | |
| 88 function() { chrome.send('onLearnMore'); }); | |
| 89 } | |
| 90 } | |
| 91 measureNavDots(); | 85 measureNavDots(); |
| 92 | 86 |
| 93 // Load the current theme colors. | 87 // Load the current theme colors. |
| 94 themeChanged(); | 88 themeChanged(); |
| 95 | 89 |
| 96 newTabView = new NewTabView(); | 90 newTabView = new NewTabView(); |
| 97 | 91 |
| 98 if (!loadTimeData.getBoolean('showWebStoreIcon')) { | 92 if (!loadTimeData.getBoolean('showWebStoreIcon')) { |
| 99 var webStoreIcon = $('chrome-web-store-link'); | 93 var webStoreIcon = $('chrome-web-store-link'); |
| 100 // Not all versions of the NTP have a footer, so this may not exist. | 94 // Not all versions of the NTP have a footer, so this may not exist. |
| (...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 446 setBookmarkBarAttached: setBookmarkBarAttached, | 440 setBookmarkBarAttached: setBookmarkBarAttached, |
| 447 setFaviconDominantColor: setFaviconDominantColor, | 441 setFaviconDominantColor: setFaviconDominantColor, |
| 448 themeChanged: themeChanged, | 442 themeChanged: themeChanged, |
| 449 updateLogin: updateLogin | 443 updateLogin: updateLogin |
| 450 }; | 444 }; |
| 451 }); | 445 }); |
| 452 | 446 |
| 453 document.addEventListener('DOMContentLoaded', ntp.onLoad); | 447 document.addEventListener('DOMContentLoaded', ntp.onLoad); |
| 454 | 448 |
| 455 var toCssPx = cr.ui.toCssPx; | 449 var toCssPx = cr.ui.toCssPx; |
| OLD | NEW |