| 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 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 startTime = Date.now(); | 153 startTime = Date.now(); |
| 154 }); | 154 }); |
| 155 } | 155 } |
| 156 | 156 |
| 157 /** | 157 /** |
| 158 * Launches the chrome web store app with the chrome-ntp-launcher | 158 * Launches the chrome web store app with the chrome-ntp-launcher |
| 159 * source. | 159 * source. |
| 160 * @param {Event} e The click/auxclick event. | 160 * @param {Event} e The click/auxclick event. |
| 161 */ | 161 */ |
| 162 function onChromeWebStoreButtonClick(e) { | 162 function onChromeWebStoreButtonClick(e) { |
| 163 if (e.button > 1) |
| 164 return; // Ignore buttons other than left and middle. |
| 163 chrome.send('recordAppLaunchByURL', | 165 chrome.send('recordAppLaunchByURL', |
| 164 [encodeURIComponent(this.href), | 166 [encodeURIComponent(this.href), |
| 165 ntp.APP_LAUNCH.NTP_WEBSTORE_FOOTER]); | 167 ntp.APP_LAUNCH.NTP_WEBSTORE_FOOTER]); |
| 166 } | 168 } |
| 167 | 169 |
| 168 /** | 170 /** |
| 169 * The number of sections to wait on. | 171 * The number of sections to wait on. |
| 170 * @type {number} | 172 * @type {number} |
| 171 */ | 173 */ |
| 172 var sectionsToWaitFor = -1; | 174 var sectionsToWaitFor = -1; |
| (...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 448 setBookmarkBarAttached: setBookmarkBarAttached, | 450 setBookmarkBarAttached: setBookmarkBarAttached, |
| 449 setFaviconDominantColor: setFaviconDominantColor, | 451 setFaviconDominantColor: setFaviconDominantColor, |
| 450 themeChanged: themeChanged, | 452 themeChanged: themeChanged, |
| 451 updateLogin: updateLogin | 453 updateLogin: updateLogin |
| 452 }; | 454 }; |
| 453 }); | 455 }); |
| 454 | 456 |
| 455 document.addEventListener('DOMContentLoaded', ntp.onLoad); | 457 document.addEventListener('DOMContentLoaded', ntp.onLoad); |
| 456 | 458 |
| 457 var toCssPx = cr.ui.toCssPx; | 459 var toCssPx = cr.ui.toCssPx; |
| OLD | NEW |