| OLD | NEW |
| (Empty) |
| 1 <!DOCTYPE html> | |
| 2 <html id="t" jsvalues="dir:textdirection;firstview:firstview;bookmarkbarattached
:bookmarkbarattached;hasattribution:hasattribution;anim:anim"> | |
| 3 | |
| 4 <meta charset="utf-8"> | |
| 5 <title jscontent="title"></title> | |
| 6 <script> | |
| 7 // Logging info for benchmarking purposes. | |
| 8 var log = []; | |
| 9 function logEvent(name) { | |
| 10 log.push([name, Date.now()]); | |
| 11 } | |
| 12 | |
| 13 var global = this; | |
| 14 | |
| 15 /** | |
| 16 * Registers a callback function so that if the backend calls it too early it | |
| 17 * will get delayed until DOMContentLoaded is fired. | |
| 18 * @param {string} name The name of the global function that the backend calls. | |
| 19 */ | |
| 20 function registerCallback(name) { | |
| 21 var f = function(var_args) { | |
| 22 var args = Array.prototype.slice.call(arguments); | |
| 23 // If we still have the temporary function we delay until the dom is ready. | |
| 24 if (global[name] == f) { | |
| 25 logEvent(name + ' is not yet ready. Waiting for DOMContentLoaded'); | |
| 26 document.addEventListener('DOMContentLoaded', function() { | |
| 27 logEvent('Calling the new ' + name); | |
| 28 global[name].apply(null, args); | |
| 29 }); | |
| 30 } | |
| 31 }; | |
| 32 global[name] = f; | |
| 33 } | |
| 34 | |
| 35 chrome.send('getShownSections'); | |
| 36 chrome.send('getMostVisited'); | |
| 37 chrome.send('getDownloads'); | |
| 38 chrome.send('getRecentlyClosedTabs'); | |
| 39 chrome.send('getTips'); | |
| 40 | |
| 41 registerCallback('onShownSections'); | |
| 42 registerCallback('mostVisitedPages'); | |
| 43 registerCallback('downloadsList'); | |
| 44 registerCallback('recentlyClosedTabs'); | |
| 45 registerCallback('tips'); | |
| 46 | |
| 47 logEvent('log start'); | |
| 48 | |
| 49 </script> | |
| 50 <link rel="stylesheet" href="new_new_tab.css"> | |
| 51 <link id="themecss" rel="stylesheet" href="chrome://theme/css/newtab.css"> | |
| 52 </head> | |
| 53 <body class="loading" | |
| 54 jsvalues=".style.fontFamily:fontfamily;.style.fontSize:fontsize"> | |
| 55 | |
| 56 <div id="main"> | |
| 57 | |
| 58 <div id="view-toolbar"><input type=checkbox id="thumb-checkbox" | |
| 59 ><input type=checkbox id="list-checkbox" | |
| 60 ><input type="button" id="option-button"></div> | |
| 61 | |
| 62 | |
| 63 <div id="option-menu" class="window-menu"> | |
| 64 <div section="THUMB" show="true" jscontent="showthumbnails"></div> | |
| 65 <div section="THUMB" show="false" jscontent="hidethumbnails"></div> | |
| 66 <div section="LIST" show="true" jscontent="showlist"></div> | |
| 67 <div section="LIST" show="false" jscontent="hidelist"></div> | |
| 68 <div section="RECENT" show="true" jscontent="showrecent"></div> | |
| 69 <div section="RECENT" show="false" jscontent="hiderecent"></div> | |
| 70 <div section="TIPS" show="true" | |
| 71 jscontent="showtips"></div> | |
| 72 <div section="TIPS" show="false" | |
| 73 jscontent="hidetips"></div> | |
| 74 </div> | |
| 75 | |
| 76 <div id="notification"> | |
| 77 <span> </span> | |
| 78 <span><span class="link" tabindex="0"></span></span> | |
| 79 </div> | |
| 80 | |
| 81 <div id="most-visited" jsskip="!processing"> | |
| 82 <a class="thumbnail-container" style="display:none" id="thumbnail-template"> | |
| 83 <div class="edit-mode-border"> | |
| 84 <div class="edit-bar"> | |
| 85 <div class="pin"></div> | |
| 86 <div class="spacer"></div> | |
| 87 <div class="remove"></div> | |
| 88 </div> | |
| 89 <span class="thumbnail-wrapper"> | |
| 90 <span class="thumbnail"></span> | |
| 91 </span> | |
| 92 </div> | |
| 93 <div class="title"> | |
| 94 <div></div> | |
| 95 </div> | |
| 96 </a> | |
| 97 | |
| 98 </div> | |
| 99 | |
| 100 <div id="lower-sections"> | |
| 101 | |
| 102 <div id="recent-activities" class="section"> | |
| 103 <h2 jscontent="recentactivities"></h2> | |
| 104 | |
| 105 <div class="hbox"> | |
| 106 | |
| 107 <div id="recent-tabs"> | |
| 108 <h3 jscontent="recentlyclosed"></h3> | |
| 109 | |
| 110 <div class="item-container"> | |
| 111 <div id="tab-items" jsskip="!processing"> | |
| 112 <div jsselect="$this"> | |
| 113 <a class="item" | |
| 114 jsdisplay="type == 'tab'" | |
| 115 jsvalues="href:url; | |
| 116 title:title; | |
| 117 .style.backgroundImage:'url(chrome://favicon/' + url + | |
| 118 ')'; | |
| 119 dir:direction; | |
| 120 .sessionId:sessionId" | |
| 121 jscontent="title"></a> | |
| 122 <div jsdisplay="type == 'window'" | |
| 123 class="item link window" | |
| 124 jsvalues=".sessionId:sessionId; | |
| 125 .tabItems:tabs" | |
| 126 tabindex="0"> | |
| 127 <span jscontent="formatTabsText($this.tabs.length)"></span> | |
| 128 </div> | |
| 129 </div> | |
| 130 </div> | |
| 131 | |
| 132 <div> | |
| 133 <a href="chrome://history/" class="item nav" | |
| 134 jscontent="viewfullhistory"></a> | |
| 135 </div> | |
| 136 | |
| 137 </div> | |
| 138 </div> | |
| 139 | |
| 140 <div id="downloads"> | |
| 141 <h3 jscontent="downloads"></h3> | |
| 142 <div class="item-container"> | |
| 143 <div id="download-items" jsskip="!processing"> | |
| 144 <a class="item" jsselect="$this" | |
| 145 jsdisplay="state != 'CANCELLED'" | |
| 146 jsvalues="href:file_path;title:url; | |
| 147 .style.backgroundImage:'url(chrome://fileicon/' + | |
| 148 file_path + ')'; | |
| 149 dir:direction; | |
| 150 .fileId:id" | |
| 151 jscontent="file_name"></a> | |
| 152 </div> | |
| 153 | |
| 154 <div> | |
| 155 <a href="chrome://downloads/" class="item nav" | |
| 156 jscontent="viewalldownloads"></a> | |
| 157 </div> | |
| 158 | |
| 159 </div> | |
| 160 </div> | |
| 161 | |
| 162 </div> | |
| 163 | |
| 164 </div><div class="spacer"> | |
| 165 | |
| 166 </div><div id="tips" class="section"> | |
| 167 <h2>Tips and Suggestions</h2> | |
| 168 <div class="item-container"> | |
| 169 <div id="tip-items" jsskip="!processing"> | |
| 170 <a class="item" jsselect="$this" | |
| 171 jsvalues="href:url;title:title" | |
| 172 jscontent="title"></a> | |
| 173 </div> | |
| 174 </div> | |
| 175 </div> | |
| 176 </div> | |
| 177 | |
| 178 </div> <!-- main --> | |
| 179 | |
| 180 <div jsskip="true"> | |
| 181 <div class="window-menu" id="window-menu"> | |
| 182 <span class="item" jsselect="$this" | |
| 183 jsvalues=".style.backgroundImage:'url(chrome://favicon/' + url + ')'; | |
| 184 dir:direction;" | |
| 185 jscontent="title"></span> | |
| 186 </div> | |
| 187 </div> | |
| 188 | |
| 189 <script src="local_strings.js"></script> | |
| 190 <script src="new_new_tab.js"></script> | |
| 191 </html> | |
| OLD | NEW |