| 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 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 280 chrome.send('notificationPromoViewed'); | 280 chrome.send('notificationPromoViewed'); |
| 281 } | 281 } |
| 282 | 282 |
| 283 cr.dispatchSimpleEvent(document, 'ntpLoaded', true, true); | 283 cr.dispatchSimpleEvent(document, 'ntpLoaded', true, true); |
| 284 document.documentElement.classList.remove('starting-up'); | 284 document.documentElement.classList.remove('starting-up'); |
| 285 | 285 |
| 286 startTime = Date.now(); | 286 startTime = Date.now(); |
| 287 }); | 287 }); |
| 288 | 288 |
| 289 preventDefaultOnPoundLinkClicks(); // From webui/js/util.js. | 289 preventDefaultOnPoundLinkClicks(); // From webui/js/util.js. |
| 290 cr.ui.FocusManager.disableMouseFocusOnButtons(); |
| 290 } | 291 } |
| 291 | 292 |
| 292 /** | 293 /** |
| 293 * Launches the chrome web store app with the chrome-ntp-launcher | 294 * Launches the chrome web store app with the chrome-ntp-launcher |
| 294 * source. | 295 * source. |
| 295 * @param {Event} e The click event. | 296 * @param {Event} e The click event. |
| 296 */ | 297 */ |
| 297 function onChromeWebStoreButtonClick(e) { | 298 function onChromeWebStoreButtonClick(e) { |
| 298 chrome.send('recordAppLaunchByURL', | 299 chrome.send('recordAppLaunchByURL', |
| 299 [encodeURIComponent(this.href), | 300 [encodeURIComponent(this.href), |
| (...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 695 setFaviconDominantColor: setFaviconDominantColor, | 696 setFaviconDominantColor: setFaviconDominantColor, |
| 696 showNotification: showNotification, | 697 showNotification: showNotification, |
| 697 themeChanged: themeChanged, | 698 themeChanged: themeChanged, |
| 698 updateLogin: updateLogin | 699 updateLogin: updateLogin |
| 699 }; | 700 }; |
| 700 }); | 701 }); |
| 701 | 702 |
| 702 document.addEventListener('DOMContentLoaded', ntp.onLoad); | 703 document.addEventListener('DOMContentLoaded', ntp.onLoad); |
| 703 | 704 |
| 704 var toCssPx = cr.ui.toCssPx; | 705 var toCssPx = cr.ui.toCssPx; |
| OLD | NEW |