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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 sectionsToWaitFor++; | 83 sectionsToWaitFor++; |
84 if (loadTimeData.getBoolean('showAppLauncherPromo')) { | 84 if (loadTimeData.getBoolean('showAppLauncherPromo')) { |
85 $('app-launcher-promo-close-button').addEventListener('click', | 85 $('app-launcher-promo-close-button').addEventListener('click', |
86 function() { chrome.send('stopShowingAppLauncherPromo'); }); | 86 function() { chrome.send('stopShowingAppLauncherPromo'); }); |
87 $('apps-promo-learn-more').addEventListener('click', | 87 $('apps-promo-learn-more').addEventListener('click', |
88 function() { chrome.send('onLearnMore'); }); | 88 function() { chrome.send('onLearnMore'); }); |
89 } | 89 } |
90 } | 90 } |
91 measureNavDots(); | 91 measureNavDots(); |
92 | 92 |
93 // Load the current theme colors. | |
94 themeChanged(); | |
95 | |
96 newTabView = new NewTabView(); | 93 newTabView = new NewTabView(); |
97 | 94 |
98 if (!loadTimeData.getBoolean('showWebStoreIcon')) { | 95 if (!loadTimeData.getBoolean('showWebStoreIcon')) { |
99 var webStoreIcon = $('chrome-web-store-link'); | 96 var webStoreIcon = $('chrome-web-store-link'); |
100 // Not all versions of the NTP have a footer, so this may not exist. | 97 // Not all versions of the NTP have a footer, so this may not exist. |
101 if (webStoreIcon) | 98 if (webStoreIcon) |
102 webStoreIcon.hidden = true; | 99 webStoreIcon.hidden = true; |
103 } else { | 100 } else { |
104 var webStoreLink = loadTimeData.getString('webStoreLink'); | 101 var webStoreLink = loadTimeData.getString('webStoreLink'); |
105 var url = appendParam(webStoreLink, 'utm_source', 'chrome-ntp-launcher'); | 102 var url = appendParam(webStoreLink, 'utm_source', 'chrome-ntp-launcher'); |
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
436 setAppToBeHighlighted: setAppToBeHighlighted, | 433 setAppToBeHighlighted: setAppToBeHighlighted, |
437 setBookmarkBarAttached: setBookmarkBarAttached, | 434 setBookmarkBarAttached: setBookmarkBarAttached, |
438 themeChanged: themeChanged, | 435 themeChanged: themeChanged, |
439 updateLogin: updateLogin | 436 updateLogin: updateLogin |
440 }; | 437 }; |
441 }); | 438 }); |
442 | 439 |
443 document.addEventListener('DOMContentLoaded', ntp.onLoad); | 440 document.addEventListener('DOMContentLoaded', ntp.onLoad); |
444 | 441 |
445 var toCssPx = cr.ui.toCssPx; | 442 var toCssPx = cr.ui.toCssPx; |
OLD | NEW |