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 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 }; | 205 }; |
206 showNotification(parseHtmlSubset(promo, tags, attrs), [], function() { | 206 showNotification(parseHtmlSubset(promo, tags, attrs), [], function() { |
207 chrome.send('closeNotificationPromo'); | 207 chrome.send('closeNotificationPromo'); |
208 }, 60000); | 208 }, 60000); |
209 chrome.send('notificationPromoViewed'); | 209 chrome.send('notificationPromoViewed'); |
210 } | 210 } |
211 | 211 |
212 cr.dispatchSimpleEvent(document, 'ntpLoaded', true, true); | 212 cr.dispatchSimpleEvent(document, 'ntpLoaded', true, true); |
213 document.documentElement.classList.remove('starting-up'); | 213 document.documentElement.classList.remove('starting-up'); |
214 }); | 214 }); |
| 215 |
| 216 preventPoundLinkClicks(); // From shared/js/util.js. |
215 } | 217 } |
216 | 218 |
217 /** | 219 /** |
218 * Launches the chrome web store app with the chrome-ntp-launcher | 220 * Launches the chrome web store app with the chrome-ntp-launcher |
219 * source. | 221 * source. |
220 * @param {Event} e The click event. | 222 * @param {Event} e The click event. |
221 */ | 223 */ |
222 function onChromeWebStoreButtonClick(e) { | 224 function onChromeWebStoreButtonClick(e) { |
223 chrome.send('recordAppLaunchByURL', | 225 chrome.send('recordAppLaunchByURL', |
224 [encodeURIComponent(this.href), | 226 [encodeURIComponent(this.href), |
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
586 setStripeColor: setStripeColor, | 588 setStripeColor: setStripeColor, |
587 showNotification: showNotification, | 589 showNotification: showNotification, |
588 themeChanged: themeChanged, | 590 themeChanged: themeChanged, |
589 updateLogin: updateLogin | 591 updateLogin: updateLogin |
590 }; | 592 }; |
591 }); | 593 }); |
592 | 594 |
593 document.addEventListener('DOMContentLoaded', ntp.onLoad); | 595 document.addEventListener('DOMContentLoaded', ntp.onLoad); |
594 | 596 |
595 var toCssPx = cr.ui.toCssPx; | 597 var toCssPx = cr.ui.toCssPx; |
OLD | NEW |