| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <html i18n-values=" | 2 <html i18n-values=" |
| 3 dir:textdirection; | 3 dir:textdirection; |
| 4 firstview:firstview; | 4 firstview:firstview; |
| 5 bookmarkbarattached:bookmarkbarattached; | 5 bookmarkbarattached:bookmarkbarattached; |
| 6 hasattribution:hasattribution; | 6 hasattribution:hasattribution; |
| 7 anim:anim; | 7 anim:anim; |
| 8 syncispresent:syncispresent; | 8 syncispresent:syncispresent; |
| 9 showsetashomepage:showsetashomepage"> | 9 showsetashomepage:showsetashomepage"> |
| 10 | 10 |
| 11 <meta charset="utf-8"> | 11 <meta charset="utf-8"> |
| 12 <title i18n-content="title"></title> | 12 <title i18n-content="title"></title> |
| 13 <script> | 13 <script> |
| 14 // Logging info for benchmarking purposes. | 14 // Logging info for benchmarking purposes. |
| 15 var log = []; | 15 var log = []; |
| 16 function logEvent(name) { | 16 function logEvent(name, shouldLogTime) { |
| 17 if (shouldLogTime) { |
| 18 chrome.send('logEventTime', [name]); |
| 19 } |
| 17 log.push([name, Date.now()]); | 20 log.push([name, Date.now()]); |
| 18 } | 21 } |
| 22 logEvent('NewTab.ScriptStart', true); |
| 19 | 23 |
| 20 var global = this; | 24 var global = this; |
| 21 | 25 |
| 22 /** | 26 /** |
| 23 * Registers a callback function so that if the backend calls it too early it | 27 * Registers a callback function so that if the backend calls it too early it |
| 24 * will get delayed until DOMContentLoaded is fired. | 28 * will get delayed until DOMContentLoaded is fired. |
| 25 * @param {string} name The name of the global function that the backend calls. | 29 * @param {string} name The name of the global function that the backend calls. |
| 26 */ | 30 */ |
| 27 function registerCallback(name) { | 31 function registerCallback(name) { |
| 28 var f = function(var_args) { | 32 var f = function(var_args) { |
| (...skipping 14 matching lines...) Expand all Loading... |
| 43 chrome.send('getMostVisited'); | 47 chrome.send('getMostVisited'); |
| 44 chrome.send('getRecentlyClosedTabs'); | 48 chrome.send('getRecentlyClosedTabs'); |
| 45 chrome.send('getTips'); | 49 chrome.send('getTips'); |
| 46 | 50 |
| 47 registerCallback('onShownSections'); | 51 registerCallback('onShownSections'); |
| 48 registerCallback('mostVisitedPages'); | 52 registerCallback('mostVisitedPages'); |
| 49 registerCallback('recentlyClosedTabs'); | 53 registerCallback('recentlyClosedTabs'); |
| 50 registerCallback('syncMessageChanged'); | 54 registerCallback('syncMessageChanged'); |
| 51 registerCallback('tips'); | 55 registerCallback('tips'); |
| 52 | 56 |
| 53 logEvent('log start'); | |
| 54 | |
| 55 </script> | 57 </script> |
| 56 <link rel="stylesheet" href="new_new_tab.css"> | 58 <link rel="stylesheet" href="new_new_tab.css"> |
| 57 <script> | 59 <script> |
| 58 // Until themes can clear the cache, force-reload the theme stylesheet. | 60 // Until themes can clear the cache, force-reload the theme stylesheet. |
| 59 document.write('<link id="themecss" rel="stylesheet" ' + | 61 document.write('<link id="themecss" rel="stylesheet" ' + |
| 60 'href="chrome://theme/css/newtab.css?' + | 62 'href="chrome://theme/css/newtab.css?' + |
| 61 (new Date()).getTime() + '">'); | 63 (new Date()).getTime() + '">'); |
| 62 </script> | 64 </script> |
| 63 </head> | 65 </head> |
| 64 <body class="loading" | 66 <body class="loading" |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 251 <img src="chrome://theme/newtab_themes_promo"> | 253 <img src="chrome://theme/newtab_themes_promo"> |
| 252 </a> | 254 </a> |
| 253 </div> | 255 </div> |
| 254 | 256 |
| 255 <div class="window-menu" id="window-tooltip"></div> | 257 <div class="window-menu" id="window-tooltip"></div> |
| 256 | 258 |
| 257 </body> | 259 </body> |
| 258 <script src="local_strings.js"></script> | 260 <script src="local_strings.js"></script> |
| 259 <script src="new_new_tab.js"></script> | 261 <script src="new_new_tab.js"></script> |
| 260 </html> | 262 </html> |
| OLD | NEW |